[Bug c/29199] do not require -O for -Wunitialized

steven at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Sep 24 08:19:00 GMT 2006



------- Comment #1 from steven at gcc dot gnu dot org  2006-09-24 08:19 -------
The choice to do things the way gcc does has been discussed many times over,
and the conclusion always has been that either all warnings should be done in
the front end, or dataflow analysis has to be used.  The latter is what GCC
does, and dataflow is indeed done only at -O1 and above.

Doing "enough dataflow analysis" for -Wuninitialized wouldn't work because many
of the uninitialized variables are discovered after optimization (e.g. removal
of unreachable code). So you would end up with a compiler that reports
different warnings at -O0 and -O1.  That is even worse than the current
situation.

Since this has been discussed so many times on the gcc mailing lists, the
current situation is the consensus (or rather status quo) that gcc developers
are happy with. That means this bug will not be fixed.


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29199



More information about the Gcc-bugs mailing list