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] New: Unreachable code at beginning of switch statement is not reported anymore


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


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