...
A break
statement is not required following the default case because it would not affect the control flow.
Exceptions
MSC17-C-EX1: The last label in a switch
statement requires no final break
. It will conventionally be the default
label.
MSC17-C-EX2: When control flow is intended to cross statement labels, it is permissible to omit the break
statement. In these instances, the unusual control flow must be explicitly documented.
...
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
|
|
| |||||||
| MISSING_BREAK | Can find instances of missing break statement between cases in | |||||||
| CC2.MSC17 | Fully implemented | |||||||
LDRA tool suite |
| 62 S | Fully implemented | ||||||
Parasoft C/C++test | 9.5 | JSF-193 | Fully implemented | ||||||
PRQA QA-C |
| 2003 | |||||||
SonarQube C/C++ Plugin |
| NonEmptyCaseWithoutBreak |
...