A switch statement shall be a well-formed switch statement
A switch statement shall be a well-formed switch statement.
The checker flags these situations:
A statement occurs between the
switch statement and the first
case statement.
For instance:
switch(ch) {
int temp;
case 1:
break;
default:
break;
}A label or a jump statement such as
goto or
return occurs in the
switch block.
A variable is declared in a case statement (outside any
block).
For instance:
switch(ch) {
case 1:
int temp;
break;
default:
break;
}
If you expect a rule violation but do not see it, refer to the documentation for Polyspace® Code Prover™ or Polyspace Code Prover Server™.
| Group: Statements |
| Category: Required |