This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Should -Wmaybe-uninitialized be included in -Wall?


On 07/09/2013 07:56 AM, Andreas Arnez wrote:
Andrew Haley <aph@redhat.com> writes:

On 07/09/2013 12:59 PM, Andreas Arnez wrote:
With this situation at hand, I wonder whether it's a good idea to keep
maybe-uninitialized included in -Wall.  Projects which have been using
"-Wall -Werror" successfully for many years are now forced to
investigate non-existing bugs in their code.

But maybe-uninitialized is very useful, and it's not really inappropriate
for -Wall.

The warning would be extremely useful, if false positives didn't obscure
real problems.  In its current state I consider its usefulness limited.
Depends on your point of view. This topic has been hashed through repeatedly on this list.

I personally like -Wall -Werror. While we do run into false positives and the set of false positives does change from release to release as a result of optimizations, I believe there's been an overall improvement in the quality of the codebases that use -Wall -Werror. I certainly see fewer bugs these days blamed on the compiler which are in fact uninitialized variables.


I'd like to revamp how we do path isolation to eliminate more of the false positives, but this warning is by its nature going to generate false positives.

What I would ask is that folks continue to file bugs for false positives. While I can't guarantee we'll fix them, they do provide a good base of tests for path sensitive analysis.


I'd also suggest that when an initialization is added merely to avoid the warning that a comment be added to the code so that folks know it's merely to avoid the warning.


Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]