[Bug c/30542] gcc 4.1.1 missing uninitialized variable warnings
muntyan at tamu dot edu
gcc-bugzilla@gcc.gnu.org
Tue Jan 23 03:09:00 GMT 2007
------- 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
More information about the Gcc-bugs
mailing list