[Bug c/88270] -Wformat-XXX option for flagging %m

2018-11-29 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88270 Eric Gallager changed: What|Removed |Added Keywords||diagnostic CC|

[Bug c/88270] -Wformat-XXX option for flagging %m

2018-11-29 Thread joseph at codesourcery dot com
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

[Bug c/88270] -Wformat-XXX option for flagging %m

2018-11-29 Thread eblake at redhat dot com
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

[Bug c/88270] -Wformat-XXX option for flagging %m

2018-11-29 Thread rjones at redhat dot com
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

[Bug c/88270] -Wformat-XXX option for flagging %m

2018-11-29 Thread eblake at redhat dot com
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");

[Bug c/88270] -Wformat-XXX option for flagging %m

2018-11-29 Thread joseph at codesourcery dot com
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

[Bug c/88270] -Wformat-XXX option for flagging %m

2018-11-29 Thread eblake at redhat dot com
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