rsmith added a comment.

I'd suggest instead of removing these warnings, we split the warning flag in 
two:

1. A warning flag that warns that there is implicit fallthrough that's not 
equivalent to `break;` (which sounds like it's what the kernel folks want in 
the 99% case) -- that is, warn if the language rule "if execution from one case 
label reaches a case label attached to a different statement, an implicit 
`break` is evaluated" could give different program behavior.
2. A warning flag that warns that there is implicit fallthrough at all (a 
superset of (1), and the same as our current warning flag) -- that is, warn if 
control flow from one case label is able to fall through a case label attached 
to a different statement.

The linux kernel folks aren't the only users of this facility, and some other 
users will want an explicit `break;` even before a set of `case` labels that 
themselves label a `break;`, and will want that enforced by warning. I'd also 
suggest that we retain our existing warning flag for (2) and add a new warning 
flag for the subset behavior of (1).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91895/new/

https://reviews.llvm.org/D91895

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to