This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: -Wformat=2 patch
- To: Michael Meissner <meissner at cygnus dot com>
- Subject: Re: -Wformat=2 patch
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Wed, 4 Oct 2000 00:21:30 +0100 (BST)
- cc: gcc-patches at gcc dot gnu dot org
On Mon, 2 Oct 2000, Michael Meissner wrote:
> I must say, I really don't like using a plain value of `2' as the value for the
> switch. I would think, something like:
>
> -Wformat
> -Wformat=nonliteral
>
> would be better.
Is this saying that the existing -Wformat=2 option should not be
documented but should instead be changed to something else?
Existing practice would make the options -Wformat-nonliteral instead of
-Wformat=nonliteral. There's then the question of what -Wall=2 (in the
C++ compiler) should do (and why the C and C++ compilers have entirely
separate warning option parsers in the first place, and why they work
through long sequences of strcmps). And -Wformat-nonliteral could itself
have multiple warning levels, if it were felt desirable at higher levels
to warn for some cases of nonliteral format arguments to vprintf-type
functions (though my proposed -Wmissing-format-attribute covers the more
useful cases of this).
--
Joseph S. Myers
jsm28@cam.ac.uk