SecureCoding-5.17

Use of an implied default in a switch statement

Required inputs: IR

Rule description is currently unavailable for legal reasons.

Possible Messages

Key

Text

Severity

Disabled

empty_default

Default clause should contain a statement (in addition to break/return) or a comment.

None

False

missing_default

Switch has no “default” clause.

None

False

Options

allow_complete_enum

allow_complete_enum : bool = True

Whether a switch having a case for all enumerators is tolerated without a default.
 

allow_empty_default_case

allow_empty_default_case : bool = False

Whether a default case is allowed to be empty except for break/throw.

MISRA C:2012 Rule 16.4 requires a comment or statement in addition.
MISRA C++2008 does not.