This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/30542] gcc 4.1.1 missing uninitialized variable warnings
- From: "muntyan at tamu dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jan 2007 03:09:24 -0000
- Subject: [Bug c/30542] gcc 4.1.1 missing uninitialized variable warnings
- References: <bug-30542-13963@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from muntyan at tamu dot edu 2007-01-23 03:09 -------
Is it really quite as 22456? That bug is about variable used for initializing
itself, and really strange do-nothing code, while this one is straightforward
use of unitialized variable:
int main (void)
{
int i, foo;
for (i = 0; i < 10; i++)
{
if (i > 5)
foo = 8;
printf ("%d\n", foo); /* uninitialized foo is printed six times */
}
}
or this one:
#include <stdio.h>
int func (void)
{
return 0;
}
int main (void)
{
int foo;
if (func ())
foo = 8;
printf ("%d\n", foo);
return 0;
}
Sorry for pain if this really a duplicate.
--
muntyan at tamu dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |muntyan at tamu dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30542