Synopsis: | The switch expression shall contain at least one case label. |
Language: | C |
Severity Level: | 7 |
Category: | STATEMENTS |
Description: |
Without case labels there can only be one path through the 'switch' statement (that of
the 'default' - which will be everything)
Example: switch (...) { default: ... } The 'switch' statement can be discarded leaving the switch statement contents as inline code. If there is no 'default' label either, then any statements within the body of the 'switch' statement will never be executed. |