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 middle-end/17843] Warning not given for unreachable code in a switch



------- Comment #6 from aldot at gcc dot gnu dot org  2008-02-02 13:43 -------
Created an attachment (id=15077)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15077&action=view)
Emit warning for surplus case labels in a switch stmt with a boolean condition

The attached patchlet would warn about a superfluous default_label in a
switch_statement that uses a boolean as condition.
It does not burden VRP to emit this warning but checks in c-common.c instead.

gcc/ChangeLog
2008-02-02  Bernhard Fischer  <aldot>

        * c-common.c (record_surplus_node): New function.
        (c_do_switch_warnings): Warn for surplus default label in switch
        stmt.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17843


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