Re: spurious use of %m format in pg_upgrade

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: spurious use of %m format in pg_upgrade
Дата
Msg-id 19760.1310012529@sss.pgh.pa.us
обсуждение исходный текст
Ответ на spurious use of %m format in pg_upgrade  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: spurious use of %m format in pg_upgrade
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> pg_upgrade's pg_scandir_internal() makes use of the non-standard %m
> format:
>
>     pg_log(PG_FATAL, "could not open directory \"%s\": %m\n", dirname);
>
> Is this an oversight, or is there an undocumented assumption that this
> code will only be used on platforms where %m works?

Surely an oversight; everywhere else in frontend code, we take care to
use strerror instead.  Is there a way to persuade gcc to complain about
such extensions when used in contexts where we don't know they work?

> (Which platforms don't have scandir() anyway?)

Hmmm ... my neolithic HPUX box has it, but OTOH the Open Group specs
seem to have added it only in Issue 7 (2008), so I'd not want to bet
money that any random Unix has got it.
        regards, tom lane


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: spurious use of %m format in pg_upgrade
Следующее
От: Radosław Smogura
Дата:
Сообщение: Re: Crash dumps