This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25181] [3.4 Regression] wrong "will never be executed" warning in switch - case block
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Nov 2005 16:11:44 -0000
- Subject: [Bug c++/25181] [3.4 Regression] wrong "will never be executed" warning in switch - case block
- References: <bug-25181-9121@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from pinskia at gcc dot gnu dot org 2005-11-30 16:11 -------
(In reply to comment #1)
> We should reject this.
But that is a different bug.
Anyways fixing up the code to be legal code:
extern int abort();
int test_18()
{
int type;
switch (type)
{
case 1:
{ int ret = abort();
if (ret != 0)
return 2;
break;}
case 3:
break;
default:
return 1;
}
return 0;
}
---
We only warn for 3.4.x and below except 3.0.4 works so this is only a 3.4
regression.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |diagnostic
Known to fail| |3.3.3 3.4.0
Known to work| |3.0.4 4.0.0 4.1.0 4.2.0
Last reconfirmed|0000-00-00 00:00:00 |2005-11-30 16:11:44
date| |
Summary|wrong "will never be |[3.4 Regression] wrong "will
|executed" warning in switch |never be executed" warning
|- case block |in switch - case block
Target Milestone|--- |3.4.6
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25181