[PATCH 4.4] fix PR17843 - warn about superfluous default label for switch(boolean_type)

Bernhard Fischer rep.dot.nop@gmail.com
Fri Jan 4 22:21:00 GMT 2008


:ADDPATCH middle-end:

(not yet up again, i guess.)

Hi,

The attached patchlet would warn about a superfluous default_label in a
switch_statement that uses a boolean as condition.

Would something like this be appropriate, provided testing passes, or
should it be more generic somehow?

gcc/ChangeLog
2008-01-04  Bernhard Fischer  <>

	* c-common.c (record_surplus_node): New function.
	(c_do_switch_warnings): Warn for surplus default label in switch
	stmt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-4.3-PR17843.00.diff
Type: text/x-diff
Size: 1617 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080104/088e0f73/attachment.bin>


More information about the Gcc-patches mailing list