* Proposal: fine-grained control over -Werror
@ 2004-03-08 14:34 Omer Shenker
2004-03-10 1:52 ` Jim Wilson
0 siblings, 1 reply; 2+ messages in thread
From: Omer Shenker @ 2004-03-08 14:34 UTC (permalink / raw)
To: gcc
Hello,
I would like to propose a new system for fine-grained control over which
warnings to treat as errors. I believe my proposal would be easy to
implement (as in, even I could write the patch) and backwards-compatible.
I propose that for each warning -Wfoo, GCC should also accept
-Wfoo=error and -Wfoo=warn. As you might have guessed, -Wfoo=error means
that warnings generated by -Wfoo are treated as errors while -Wfoo=warn
gives the usual non-fatal warnings. Normally =warn is the default, and
only =error is useful to specify. When -Werror is in use, =error is the
default and =warn is available to turn it off.
For flags that turn on multiple classes of warnings, like -Wall, their
arguments would apply to each member of the class. For example if -Wfoo
turns on -Wbar and -Wbaz, then -Wfoo=error would imply -Wbar=error and
-Wbaz=error.
This new system would not apply to -W, because there might be confusion
between -Werror and -W=error and -W is deprecated for -Wextra anyway.
There would naturally be no point in accepting -Wno-foo=error, since
it's hard to turn a disabled warning into an error. :)
I am throwing this out as a suggestion because I have often wished for
it. For example, I almost always want what -Wformat-security=error and
-Wsign-compare=warn would do. I am willing to try implementing it myself
if the powers that be would be receptive to a patch, although I'm sure
someone familiar with GCC internals could do it much faster.
(I should clarify what I mean by backwards-compatible. A quick test
shows that -Wfoo=extra is an error in 3.3. So the new flags would not
work on old compilers, but that is no surprise. Rather, the old flags
will work on new compilers, because -Werror will still have the expected
semantics.)
--
Omer Shenker
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Proposal: fine-grained control over -Werror
2004-03-08 14:34 Proposal: fine-grained control over -Werror Omer Shenker
@ 2004-03-10 1:52 ` Jim Wilson
0 siblings, 0 replies; 2+ messages in thread
From: Jim Wilson @ 2004-03-10 1:52 UTC (permalink / raw)
To: Omer Shenker; +Cc: gcc
Omer Shenker wrote:
> I propose that for each warning -Wfoo, GCC should also accept
> -Wfoo=error and -Wfoo=warn.
Some of the warnings already use the = form, e.g. -Wformat=2. So there
is a conflict here.
It is unlikely that anything will happen unless you volunteer a patch.
It is probably a lot of work to go through and identify everyplace where
a warning is used and then add an optional error check. Probably not
feasible unless the warning flags are redesigned a bit, which would be
even more work.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-03-10 1:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-08 14:34 Proposal: fine-grained control over -Werror Omer Shenker
2004-03-10 1:52 ` Jim Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).