This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25314] New: Unreachable code at beginning of switch statement is not reported anymore
- From: "Uwe dot Seimet at seimet dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Dec 2005 18:24:17 -0000
- Subject: [Bug c++/25314] New: Unreachable code at beginning of switch statement is not reported anymore
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The warning available in previous versions of gcc (at least until gcc 3.3)
'unreachable code at beginning of switch statement' is not reported anymore.
This behavior hides programming errors. When compiling this code sample with
'c++ -Wall test.cpp':
int main()
{
int a;
switch(1)
{
a = 1;
break;
default:
break;
}
return 0;
}
No warning is reported. Older versions of gcc issue a warning here. Using
additional switch-related warnings like -Wswitch does not change anything.
--
Summary: Unreachable code at beginning of switch statement is not
reported anymore
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Uwe dot Seimet at seimet dot de
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25314