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 по дате отправления: