https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88270
Eric Gallager changed:
What|Removed |Added
Keywords||diagnostic
CC|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88270
--- Comment #6 from joseph at codesourcery dot com ---
A format attribute for syslog is bug 15338.
(A fully general system for extensible format checking is hard, as I think
it would be a bad idea for it effectively to turn the internals of the
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88270
--- Comment #5 from Eric Blake ---
For what it's worth, POSIX requires syslog() to support %m, and this is the
case even on BSD systems. So a new __attribute__((format(syslog, x, y)))
archetype would be an easy way of at least notating functions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88270
--- Comment #4 from Richard W.M. Jones ---
FWIW I was testing:
gcc (FreeBSD Ports Collection) 7.3.0
$ cat test.c
#include
int
main (int argc, char *argv[])
{
printf ("%m\n");
return 0;
}
$ gcc -Wformat test.c
(no warnings)
$ gcc -Wformat
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88270
--- Comment #3 from Eric Blake ---
Confirmed that -Wpendantic flags %m:
$ gcc -Wpedantic -Wformat foo.c -o foo
foo.c: In function ‘main’:
foo.c:3:10: warning: ISO C does not support the ‘%m’ gnu_printf format
[-Wformat=]
printf("%m %B\n");
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88270
--- Comment #2 from joseph at codesourcery dot com ---
The -Wformat -Wpedantic comment should warn for nonstandard formats - but
would do so for all format functions, not a subset. And while we have
separate printf and gnu_printf arguments you
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88270
--- Comment #1 from Eric Blake ---
Note that gcc -Wformat DOES flag things like printf("%B"), %m is the only
special-case where it is not flagged even on systems where it does not work,
and where we'd want fine-tuned control over whether a partic