Re: INT64_FORMAT in translatable strings - Mailing list pgsql-hackers

From Tom Lane
Subject Re: INT64_FORMAT in translatable strings
Date
Msg-id 946959.1619098186@sss.pgh.pa.us
Whole thread Raw
In response to INT64_FORMAT in translatable strings  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: INT64_FORMAT in translatable strings  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
Julien Rouhaud <rjuju123@gmail.com> writes:
> On Thu, Apr 22, 2021 at 07:49:23PM +0900, Michael Paquier wrote:
>> May I ask why you are using "unsigned long long int" rather uint64?

> My understanding is that it's the project standard.  See e.g.
> https://www.postgresql.org/message-id/1730584.1617836485@sss.pgh.pa.us

Indeed, using %lld, %llu, etc with a matching cast to "long long" or
"unsigned long long" is the approved way.  Don't use [u]int64 because
that does not necessarily match these format specs.  It's probably
physically compatible, but that won't stop pickier compilers from
nagging about a format mismatch.

But what I thought Michael was griping about is the use of "int",
which is a noise word here.  Either "long long int" or "long long"
will work, but I think we've preferred the latter because shorter.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Daniil Zakhlystov
Date:
Subject: Re: libpq compression
Next
From: Fujii Masao
Date:
Subject: Re: wal stats questions