This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/25314] [4.2/4.3/4.4 Regression] Unreachable code at beginning of switch statement is not reported anymore



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]