-Wformat=2 patch
Joseph S. Myers
jsm28@cam.ac.uk
Tue Oct 3 16:21:00 GMT 2000
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
More information about the Gcc-patches
mailing list