This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR 30437 [4.0/4.1/4.2/4.3 Regression] -Wno-all is rejected (try 2)
On 25/01/07, Steve Kargl <sgk@troutmask.apl.washington.edu> wrote:
On Thu, Jan 25, 2007 at 11:25:28PM +0000, Manuel L?pez-Ib??ez wrote:
> On 25/01/07, FX Coudert <fxcoudert@gmail.com> wrote:
>
> Maybe to disable -Wall warnings? Maybe because a project CFLAGS have
> -Wall but you don't want to get warnings for a particular file, so you
> add -Wno-all when building that file? Why do we have Wno-* options at
> all then?
-Wall is a meta-option that turns on a large number of option.
You may want all -Wall options except -Wone-ring. It is logical
to have -Wno-one-ring, so you can do '-Wall -Wno-one-ring'. It
is completely illogical to do "-Wall -Wno-all" on a command line.
Your project CLFAGS example make no sense. The project
would need to handle that one special file has an exception
with or without -Wno-all, so you end up with a custom build
(e.g. Makefile target).
We have -Wno-* form for options that are not enabled by any other
meta-option. Should we remove them? We also have positive form
(-Woverflow, -Wdeprecated) for options that are always enabled, so you
only need the negative to disable them. Do you propose to reject the
positive version since they make as much sense as -Wno-all?
Say you want something from CFLAGS except -Wall warnings (maybe
CFLAGS=" XXXX -pedantic -Wc++-compat -Wall") so instead of doing
CFLAGS += "-Wno-all" what am I supposed to do? Of course, the example
is lame, I made it up just now. The best reasons are consistency and
the principle of least surprise. Lesser reasons are that -Wall
-Wno-all is perfectly defined, it is as easier to implement as to not
implement, it doesn't add any overhead, so why limit our flexibility
just because right now we cannot think in an use for it.
Still, if you want it for fortran, be my guest. I will prepare a patch
that won't break all other front-ends, but breaking them just because
you personally don't want to allow -Wno-all for fortran because "I
cannot think of an use for it" is actually a regression.