Andres Freund <> writes:
> On 2014-01-23 12:54:22 -0500, Tom Lane wrote:
>> Andres Freund <> writes:
>>> snprintf(buf64, 100, UINT64_FORMAT, ~(size_t)0);

>> Actually, that coding isn't gonna work at all on platforms where size_t
>> isn't the same size as uint64.  We could make it work by explicitly
>> casting the argument to whatever type we've decided to use as uint64
>> ... but unless we want to include c.h here, that would require a lot of
>> extra cruft, and I'm really not sure it's gaining anything anyway.

> Hm, yea, it should be casted. I think we should have the type ready in
> PG_INT64_TYPE, confdefs.h should contain it at that point.

Ah, I'd forgotten that configure defined any such symbol.  Yeah, that
will work.

> Well, the reasoning, weak as it may be, was that that we want to see
> whether we successfully recognize z as a 64bit modifier or not.

I'm dubious that this is really adding much, but whatever.

I checked on my HPUX box and find that what it prints for "%zu" is
"zu", confirming my thought that it'd just abandon processing of the
%-sequence.  (Interesting that it doesn't eat the "z" while doing
so, though.)

                        regards, tom lane

Sent via pgsql-hackers mailing list (
To make changes to your subscription:

Reply via email to