Re: spurious use of %m format in pg_upgrade

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: spurious use of %m format in pg_upgrade
Дата
Msg-id 1310069389.31709.10.camel@vanquo.pezone.net
обсуждение исходный текст
Ответ на Re: spurious use of %m format in pg_upgrade  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On tor, 2011-07-07 at 00:22 -0400, Tom Lane wrote:
> Is there a way to persuade gcc to complain about such extensions when
> used in contexts where we don't know they work?

I don't think so.

First of all, the comment in pg_config_manual.h says that we *want* the
compiler to recognize %m as valid, and we apply the same attribute
globally.  And secondly, the difference between the gnu_printf attribute
and the plain printf attribute is that the latter checks for what the
target's C library accepts, which is equivalent to gnu_printf if you're
on glibc, at least.  According to the gcc source code, the target is
supposed to override the conversion specifier list accordingly, but it
looks like, for example, FreeBSD doesn't do that, which could be
considered a bug there.  The only override in the gcc source code itself
is MinGW, which is where the whole trouble in pg_config_manual.h stems
from in the first place.  (Look for TARGET_OVERRIDES_FORMAT_ATTRIBUTES
in the gcc source if you want to investigate.)

There does not, unfortunately, appear to be an attribute that says to
check conversion specifiers according to some standard (even though the
internal structures of gcc appear to support that, but they'd currently
have %m in the wrong category there anyway).




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Inconsistency between postgresql.conf and docs
Следующее
От: Tom Lane
Дата:
Сообщение: Re: SSI atomic commit