Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

Compass/ROSE

 

 

 

Coverity

Include Page
Coverity_V
Coverity_V

MISSING_BREAK

Can find instances of missing break statement between cases in switch statement

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.MSC17

Fully implemented

LDRA tool suite
Include Page
LDRA_V
LDRA_V
62 SFully implemented
Parasoft C/C++test9.5JSF-193Fully implemented
PRQA QA-C
Include Page
PRQA QA-C_v
PRQA QA-C_v
2003 
SonarQube C/C++ Plugin
Include Page
SonarQube C/C++ Plugin_V
SonarQube C/C++ Plugin_V
NonEmptyCaseWithoutBreak 

...