This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/30575] Missing warning about unitialized variable
- From: "muntyan at tamu dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jan 2007 13:27:00 -0000
- Subject: [Bug c/30575] Missing warning about unitialized variable
- References: <bug-30575-13438@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from muntyan at tamu dot edu 2007-01-25 13:27 -------
The original code warns if you use -O3 (I guess because of inlining or
something), the code below is better:
-------------------------
#include <stdio.h>
int func (void);
int main (void)
{
int foo;
if (func ())
foo = 8;
printf ("%d\n", foo);
return 0;
}
-------------------------
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30575