Re: Fixes for compiler warnings

Поиск
Список
Период
Сортировка
От Jeroen Vermeulen
Тема Re: Fixes for compiler warnings
Дата
Msg-id 4975F54F.4000703@xs4all.nl
обсуждение исходный текст
Ответ на Re: Fixes for compiler warnings  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut wrote:

> -Wformat-security warns about
> 
>     printf(var);
> 
> but not about
> 
>     printf(var, a);
> 
> I don't understand that; the crash or exploit potential is pretty much the 
> same in both cases.

Not sure this is the reason, but in the first case any risk is trivially 
avoided by using puts() or printf("%s", var) instead.  So printf(var) is 
almost certainly not what you mean.

I think that's a reasonable warning to have enabled, whereas the other 
one is more of a "try it sometime, you might find something" kind of 
warning.


Jeroen


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: FWD: Re: Updated backslash consistency patch
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: Re: is 8.4 array_agg() supposed to work with array values?