Re: -Wformat-zero-length

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: -Wformat-zero-length
Дата
Msg-id 3976.1310075127@sss.pgh.pa.us
обсуждение исходный текст
Ответ на -Wformat-zero-length  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: -Wformat-zero-length
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> I was adding gcc printf attributes to more functions in obscure places,
> and now I'm seeing this in pg_upgrade:

> relfilenode.c:72:2: warning: zero-length gnu_printf format string [-Wformat-zero-length]

> So the options I can see are either adding the compiler option
> -Wno-format-zero-length (with configure check and all), or hack up the
> code to do something like this instead:  Before:

> prep_status("");

> After:

> prep_status("%s", "");

> Comments?

Shouldn't it be prep_status("\n")?  If not, why not?  (Right offhand, it
looks to me like prep_status could stand to be redefined in a less
bizarre fashion anyhow.)
        regards, tom lane


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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: SSI atomic commit
Следующее
От: Tom Lane
Дата:
Сообщение: Re: -Wformat-zero-length