[Bug middle-end/36296] wrong warning about potential uninitialized variable
vincent at vinc17 dot org
gcc-bugzilla@gcc.gnu.org
Thu May 22 08:34:00 GMT 2008
------- Comment #2 from vincent at vinc17 dot org 2008-05-22 08:34 -------
The severity should probably be changed to enhancement because gcc behaves as
documented (well, almost).
What can be done IMHO is:
1. Split the -Wuninitialized into two different warnings: one for which gcc
knows that the variable is uninitialized and one for which it cannot decide.
-Wuninitialized currently does both.
2. Provide an extension so that the user can tell gcc not to emit a warning for
some particular variable. This would sometimes be better than adding a dummy
initialization (which has its own drawbacks).
In the mean time, make the documentation better concerning -Wuninitialized:
change the first sentence "Warn if an automatic variable is used without first
being initialized [...]" to "Warn if an automatic variable *may be* used
without first being initialized" (though the behavior is detailed later).
--
vincent at vinc17 dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vincent at vinc17 dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36296
More information about the Gcc-bugs
mailing list