This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]