[RFC] -Weverything
Segher Boessenkool
segher@kernel.crashing.org
Mon Jan 28 22:53:00 GMT 2019
On Sun, Jan 27, 2019 at 01:19:08PM -0800, Andrew Pinski wrote:
> On Sun, Jan 27, 2019 at 1:02 PM Thomas König <tk@tkoenig.net> wrote:
> >
> > Am 27.01.19 um 21:52 schrieb Steve Kargl:
> >
> > > In fact, I would be in favor of removing -Wall, as it is misnamed,
> > > in favor of -Wlevel=0,1,2,3... -Wlevel=0 default warnings.
> > > -Wlevel=1 is equivalent to -Wall. -Wlevel=2 is -Wall -Wextra
> > > (and maybe -Wsurprising).
> >
> > ... and -Wlevel=3 could then be -Wkitchen-sink, at least from the
> > Fortran-only side. :-)
> >
> > I quite like that idea. I don't think -Wall will be deprecated soon,
> > but -Wlevel sounds like a good thing to implement.
>
> Maybe instead of -Wlevel= why not just -W0, -W1, -W2, -W3; -W would be
> -W1 (because -W already exists)? Just like -O :).
-Wextra is an alternative spelling for -W, which should be the same as -W1
(if you want to make this similar to -O<n>); and -W0 would mean warnings
off, which already has an option, -w (while -o is something else).
-O and -W cannot be made very similar.
-Wall is not the warnings with low false positive rate, or low hit rate
("noisy"). The criterion (shared with -Wextra) is that it is easy to shut
up the warning by doing a trivial, obvious change to the code. This is
of course highly subjective (not that other considerations like "how useful
is this warning" are any better!)
Segher
More information about the Gcc
mailing list