Re: MinGW / Windows / printf format specifiers

Поиск
Список
Период
Сортировка
Искать
От
Craig Ringer
Тема
Re: MinGW / Windows / printf format specifiers
Дата
Msg-id
CAMsr+YGh1fhc5f4JnA1HSi5o+tdndfKvVA-5q8VzJSOWQV738w@mail.gmail.com
Ответ на
Список
Дерево обсуждения
MinGW / Windows / printf format specifiers Chapman Flack <chap@anastigmatix.net>
Re: MinGW / Windows / printf format specifiers Craig Ringer <craig@2ndquadrant.com>
Re: MinGW / Windows / printf format specifiers Tom Lane <tgl@sss.pgh.pa.us>
On 19 February 2016 at 12:15, Chapman Flack <chap@anastigmatix.net> wrote:
 

The cause seems to be that Windows conventions have int = long = int32
(even on 64-bit platforms) and only 'long long' = int64.

Yes, it's an LLP64 platform.

 
The Java JNI
headers of course know this, so they type jlong as 'long long', while
jint they type as 'long' - curiously, because they could just call it
int and get the same width. Maybe a habit from a 16-bit C environment?

They should be using the (u)int(nn)_t typedefs like int64_t, but some compilers lag in their support for them.
 
Have issues like this been dealt with in PostgreSQL code before, and did
a favorite approach emerge?

INT64_FORMAT and UINT64_FORMAT

src/include/c.h 

git grep INT64_FORMAT


--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-hackers по дате отправления
От: Michael Paquier
Дата:
От: Kyotaro HORIGUCHI
Дата:
FAQ