[Bug c/25314] [4.2/4.3/4.4 Regression] Unreachable code at beginning of switch statement is not reported anymore
jakub at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Dec 11 08:47:00 GMT 2008
------- Comment #11 from jakub at gcc dot gnu dot org 2008-12-11 08:45 -------
You do not to warn for:
void foo (int c)
{
int a;
switch (c)
{
foo:
a = 1;
break;
case 5:
goto foo;
}
}
(any label should stop the search).
You ICE on:
void foo (int c)
{
switch (c)
{
int a;
case 5:
a = 1;
break;
}
}
plus the CASE_LABEL_EXPR (or LABEL_EXPR) can be nested in arbitrary amount of
STATEMENT_LIST/BIND_EXPRs (not sure about e.g. try blocks etc.).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25314
More information about the Gcc-bugs
mailing list