c/5044: -Wswitch and `default' case

tromey@redhat.com tromey@redhat.com
Fri Dec 7 10:49:00 GMT 2001


>Number:         5044
>Category:       c
>Synopsis:       -Wswitch and `default' case
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 07 10:46:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Tom Tromey <tromey@redhat.com>
>Release:        current cvs
>Organization:
>Environment:

>Description:
Currently -Wswitch requires that a switch not
have a default case.  This isn't always the most
useful thing though.  In my situation, I have a 
bytecode interpreter.  I'd like to use -Wswitch to
ensure that I haven't left out a bytecode.  But
I'd also like to have a default case so that 
erroneous bytecodes are caught.
I think -Wswitch should be augmented to allow this case.
Perhaps a new -Wswitch-default flag could be added.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list