This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
GCC warning -Wswitch
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb at sources dot redhat dot com
- Date: Sun, 13 Jan 2002 10:37:48 -0500
- Subject: GCC warning -Wswitch
Just FYI,
I just submitted a preliminary patch to GCC to break -Wswitch into:
-Wswitch-default: warn if default missing
-Wswitch-enum: warn if an enum switch does't cover the enum (even when
there is a default which is different to -Wswitch).
I think these will make the -Wswitch useful.
Now if someone wants to try to add a -Wswitch-fallthrough (for ``switch
(s) { case 1: /*notfallthrough*/ case 2: printf("h"); /*fallthrough*/
case 3: printf("i"); }'') to GCC you're welcome to try :-)
enjoy,
Andrew