On Fri, 2015-09-04 at 10:13 -0700, Chih-Hung Hsieh wrote:
Clang compiler gives warning to non-standard format %Z.
I actually had some trouble finding the definition of %Z. The newer
printf manpage doesn't even mention it. But older manpages actually say
under 'z': "Linux libc5 has Z with this meaning. Don't use it."
Also
http://www.gnu.org/software/libc/manual/html_node/Integer-Conversions.html does say
"‘Z’ is a GNU extension predating this addition and should not be used in new
code."
So, lets not use it.
gcc does warn about this with -Wformat -Wpedantic.
"warning: ISO C does not support the ‘Z’ gnu_printf length modifier"
But since we don't want -Wpedantic in general I filed a bug to see if we
can get a -Wformat-pedantic.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67479
I adjusted the description a little to explain the background and added
ChangeLog entries (mainly to help me make sure I reviewed all changes).
Pushed to master as attached.
Thanks,
Mark