This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -Wformat-sign-mismatch?
Joseph S. Myers wrote:
On Mon, 10 Feb 2003, Dan Kegel wrote:
Thanks very much. I did read the manual, but it didn't
hint that -pedantic would turn on this kind of -Wformat check.
Would it be appropriate to spell this out more clearly? e.g.
It already says "if -pedantic is used with -Wformat, warnings will be
given about format features not in the selected standard version". This
includes various pointer type mismatches that the C standard doesn't
permit for variadic functions, but which most implementations (and the
Single Unix Specification) permit, as well as the obvious cases such as
additional format specifiers.
As you point out in the above paragraph, this is not obvious.
The paragraph you just wrote, if added to the manual, would clarify this.
e.g.
--- invoke.texi.old Mon Feb 10 13:21:32 2003
+++ invoke.texi Mon Feb 10 13:46:51 2003
@@ -2025,6 +2025,9 @@
in the selected standard version (but not for @code{strfmon} formats,
since those are not in any version of the C standard). @xref{C Dialect
Options,,Options Controlling C Dialect}.
+It will also warn about various pointer type mismatches that the C standard
+doesn't permit for variadic functions, but which most implementations (and the
+Single Unix Specification) permit.
Since @option{-Wformat} also checks for null format arguments for
several functions, @option{-Wformat} also implies @option{-Wnonnull}.