I feel like the common case here is not actually fall-through but a missing 
break, though like David said there are many other ways to exit a switch. I 
would expect something like this instead:

warning: fall-through to subsequent switch case
note: use 'break' to prevent fall-through
  [fixit]
note: use 'fallthrough' attribute to silence this warning
  [fixit]

If we really want to go crazy, we could look and see if 'return' is more 
appropriate than 'break', but I think probably these would cover the common 
cases.

Also, the attribute fixit would have to only use square-bracket syntax if it's 
supported, and possibly disabled altogether if the current language options 
don't support attributes at all, i.e. non-GNU. (The warning could still be 
disabled with pragmas, after all.)

Jordy
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to