This is the mail archive of the
mailing list for the GCC project.
Re: handling of warnings
On Wed, 2003-08-13 at 22:40, Gabriel Dos Reis wrote:
> skaller <email@example.com> writes:
> | But please note: I'm only talking about *warning control options*
> | here, not general options. I agree, if a semantic or model
> | control option is wrong, the compiler should error out.
> The same is true for switches that control warning.
> If we accepted that option in 3.2.x without saying anything, how could
> you tell whether we understood your request but implemented something
> wrong, or we didn't undertand your request?
I don't have any idea what you mean by the first case.
In the second case, you can always have a warning that warns
about warning options that are not understood.
However that isn't a problem, the problem is if a client
turns a switch on:
doesn't see any warnings .. and assumes they have't
written any naughty code. Actually, it should have been
but the two responses:
(a) no diagnostics issued for naughty code
(b) no diagnostics issued for wrong spelling of option
together mean the client will be mislead by the lack of response,
since they can't tell (a) and (b) apart, and aren't stimulated
to find out (since both cases are characterised by no output).
I agree diagnosing wrong warning options prevents this problem.
My argument is, however, that most warning controls are
then useless, which is a much more serious loss.
I have shown you that I have been forced to use -w.
I hate that. I hope you agree I shouldn't have to.
But you can't argue that there is an option in
3.4 or whatever, because I don't have 3.4, and neither
will my clients.I want to put
into my build script, but I can't. I'm suggesting
this class of problem can be fixed once and for all
by simply ignoring bad warning options. If you wish,
you can issue a WARNING by default, provided there
is an option for switching THAT warning off.
You can also have a switch that into an error.
You can even leave the default exactly as it is,
and provide a switch to cause wrong warning options
to be ignore .. and then I can just turn it on.
The point is that with any of these solutions,
I can enable or disable warnings for ALL versions
of the compiler. Something like:
IF you can detect problem X, please do"
EVEN IF you can detect problem X, please DONT