This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/17843] Warning not given for unreachable code in a switch
- From: "aldot at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Feb 2008 13:43:30 -0000
- Subject: [Bug middle-end/17843] Warning not given for unreachable code in a switch
- References: <bug-17843-9409@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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