This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c/8828: gcc reports some code is unreachable when it is not
- From: reichelt at igpm dot rwth-aachen dot de
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, rcampbell at tropicnetworks dot com
- Date: 6 Dec 2002 09:29:12 -0000
- Subject: Re: c/8828: gcc reports some code is unreachable when it is not
- Reply-to: reichelt at igpm dot rwth-aachen dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, rcampbell at tropicnetworks dot com, gcc-gnats at gcc dot gnu dot org
Synopsis: gcc reports some code is unreachable when it is not
State-Changed-From-To: open->analyzed
State-Changed-By: reichelt
State-Changed-When: Fri Dec 6 01:29:11 2002
State-Changed-Why:
Confirmed.
An even shorter example is the following:
-----------------snip here----------------
void foo(int i)
{
switch(i) {
case 0:
break;
case 1:
break;
}
}
-----------------snip here----------------
Compiling this with gcc 3.2.1 or mainline I get the message
PR8828.c: In function `foo':
PR8828.c:7: warning: will never be executed
PR8828.c:5: warning: will never be executed
i.e. the compiler complains about the "break" statements.
This is a regression from gcc 3.0.4 where the warning is not issued.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8828