This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
GCC's -Wswitch-default flag
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb at sources dot redhat dot com
- Date: Sun, 10 Feb 2002 18:03:19 -0500
- Subject: GCC's -Wswitch-default flag
For what its worth,
GCC is getting a -Wswitch-default flag (warn if a switch doesn't have a
default case). I checked GDB (actually a few weeks ago) and building
one target identified 70 cases (not had given ~1000 switches).
Anyway, this new flag can be tossed onto the end of the list of possible
-Werror flags that GDB may one day consider adding.
enjoy,
Andrew
PS: If GCC fixes its -Wswitch, there is also a -Wswitch-enum (warn
missing enum case). Just need -Wswitch-break (warn fallthrough) :-)