Created attachment 29222 [details] format-warning.c format-warning.c: #include <stdio.h> int main(void) { const char *s = "%s\n"; printf(s, "abcd"); return 0; } $ gcc -Wall -Werror -Werror=format=2 -o format-warning format-warning.c (no error) $ gcc -Wall -Werror -Werror=format -Werror=format-nonliteral -Werror=format-security -Werror=format-y2k -o format-warning format-warning.c format-warning.c: Na função ‘main’: format-warning.c:6:2: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
I think this may be fixed in GCC 4.8, but I don't have a recently build GCC at hand to test it.
(In reply to comment #1) > I think this may be fixed in GCC 4.8, but I don't have a recently build GCC at > hand to test it. Actually, it is not. opts.c:control_warning_as_error doesn't handle options with joined arguments, the argument is ignored. Extra code would need to be added to check that the option is joined, that it has an argument, read the argument and pass the correct value to control_warning. Then, it should work.