This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Uninitialized warnings
- To: carlo at alinoe dot com, dalej at apple dot com
- Subject: Re: Uninitialized warnings
- From: dewar at gnat dot com
- Date: Tue, 17 Jul 2001 22:55:35 -0400 (EDT)
- Cc: amylaar at redhat dot com, gcc at gcc dot gnu dot org, jbuck at synopsys dot COM,kevina at users dot sourceforge dot net
<<Please don't add any warning that can generate false positives.
I'd rather have no warning at all for 100 actual bugs than
100 correct warnings and a false positive. The reason for
that is that I always use -Werror: I want gcc to abort when
a warning is generated. The reason for THAT is that a warning
always means that something *is* wrong and will (likely) cause
a runtime error.
>>
I strongly disagree with this point of view. Any warning by its nature
may have false positives, you are after all dealing with legal code with
a well defined meaning, you are just guessing that it is not the intended
meaning, but you cannot be sure your guess is correct.
Obviously you don't want too many false positives, but the 100-1 suggestion
here is way off the reasonable compromise point.
<<If I'd have to suggest an alternative/compromise, then I'd say:
make it possible to temporally turn off a specific warning in
the source code.
>>
In GNAT, we have added pragma Warnings (On | Off); to handle this problem
when it occasionally arises, since it is a requirement of the GNAT build
that no warnings are generated