GCC-4.3.3, all previous versions are unaffected.
This snippet:
---- 8< ------- 8< --------
#include <stdio.h>
int main()
{
static const char *s = "hello world";
printf(s);
return 0;
}
----- 8< ------ 8< ---------
built with -Wformat throws this warning:
test-f.c: In function 'main':
test-f.c:5: warning: format not a string literal and no format arguments
Which is very inconvenient when building linux kernels for certains targets
which enable -Werror.
--
Summary: -Wformat warns on printf() with stringpointer as sole
argument
Product: gcc
Version: 4.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mano at roarinelk dot homelinux dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39044