Re: Add %z support to elog/ereport?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Add %z support to elog/ereport?
Дата
Msg-id 21699.1390501480@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Add %z support to elog/ereport?  (Andres Freund <andres@2ndquadrant.com>)
Ответы Re: Add %z support to elog/ereport?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> On 2014-01-23 12:54:22 -0500, Tom Lane wrote:
>> Andres Freund <andres@2ndquadrant.com> 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Closing commitfest 2013-11
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Case sensitive mode in windows build option