GCC 2.95.2 -- warning where there is no reason for one
Martin v. Loewis
martin@loewis.home.cs.tu-berlin.de
Wed Apr 12 13:53:00 GMT 2000
> // Although I have obviously exhausted all legitimate variants of
> // enumerator "EMy e" in the switch, however I still get this
Thanks for your bug report. This is not a bug, but an implementation
limitation:
`-Wuninitialized'
...
These warnings are made optional because GCC is not smart enough
to see all the reasons why the code might be correct despite
appearing to have an error. Here is one example of how this can
happen:
{
int x;
switch (y)
{
case 1: x = 1;
break;
case 2: x = 4;
break;
case 3: x = 5;
}
foo (x);
}
If the value of `y' is always 1, 2 or 3, then `x' is always
initialized, but GCC doesn't know this.
Regards,
Martin
More information about the Gcc-bugs
mailing list