This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug regression/24956] Optimizer and uninitialised variables.
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Nov 2005 13:37:35 -0000
- Subject: [Bug regression/24956] Optimizer and uninitialised variables.
- References: <bug-24956-11742@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from pcarlini at suse dot de 2005-11-20 13:37 -------
(In reply to comment #1)
> There is no "correct" output when you use a variable uninitialized. It's
> undefined behavior. Printing any number, or crashing, would be completely
> valid behaviors as far as gcc is concerned.
Falk, of course you are right. However, when I saw the PR coming, I wondered
whether the point was also that it would be nice having the warning emitted
also at low optimization levels. Other compilers can do that, AFAIK. Maybe
we already have something open about that, tough, as enhancement request.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24956