This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Should -Wjump-misses-init be in -Wall?
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 19 Jun 2009 22:12:50 -0700
- Subject: Should -Wjump-misses-init be in -Wall?
I recently added the new -Wjump-misses-init warning option. It warns
when a goto or switch jumps into the scope of an initialized variable
without actually initializing the variable. I added the warning to
-Wall because it seems to me to fit the criteria of -Wall: a dubious
code practice which is easy to avoid.
H.J. filed PR 40500 about this, arguing that this warning should not be
in -Wall.
Any opinions on this? Should I take the new warning out of -Wall?
-Wjump-misses-init should of course continue to be turned on by
-Wc++-compat, as such jumps are invalid C++.
Ian