This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
PATCH for Re: -Wformat-sign-mismatch?
On Mon, 10 Feb 2003, Dan Kegel wrote:
>> 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.
This thread seems to have died, with Dan's patch being the last message.
I agree that the current formulation is not that clear (and we really
should encourage users like Dan to contribute doc patches), so I updated
Dan's patch.
Any objections to the following?
Gerald
2003-02-17 Dan Kegel <dkegel@ixiacom.com>
* doc/invoke.texi (Warning Options): Complete -Wformat.
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.242
diff -u -3 -p -r1.242 invoke.texi
--- doc/invoke.texi 16 Feb 2003 01:11:41 -0000 1.242
+++ doc/invoke.texi 16 Feb 2003 22:05:33 -0000
@@ -2026,6 +2026,10 @@ in the selected standard version (but no
since those are not in any version of the C standard). @xref{C Dialect
Options,,Options Controlling C Dialect}.
+@option{-Wformat} will also warn about various pointer type mismatches
+that the C standard does not 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}.