GCC's -Wswitch-default flag

Andrew Cagney ac131313@cygnus.com
Sun Feb 10 15:03:00 GMT 2002


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) :-)



More information about the Gdb mailing list