Re: Wformat-security and string literal

2005-10-17 Thread Hagen Paul Pfeifer
* Joe Buck | 2005-10-17 09:28:51 [-0700]: >If we go down that route, the option would only work correctly if >optimization is enabled, because you expect gcc to trace the source >of pointers, and see what the pointers point to, and check the original >strings for format characters. ACK - gcc beha

Re: Wformat-security and string literal

2005-10-17 Thread Joe Buck
On Mon, Oct 17, 2005 at 11:49:05AM +0200, Hagen Paul Pfeifer wrote: > Following code generate a _dubious_ warning message: > > int main(void) { > const char * const literal = "xxx"; > fprintf(stderr, literal); > return 0; > } > > cc -Wall -Wformat-security -o main main.c > main.c: In

Wformat-security and string literal

2005-10-17 Thread Hagen Paul Pfeifer
Following code generate a _dubious_ warning message: int main(void) { const char * const literal = "xxx"; fprintf(stderr, literal); return 0; } cc -Wall -Wformat-security -o main main.c main.c: In function `main': main.c:9: warning: format not a string literal and no format argumen