Synopsis: | The default clause shall be the last entry in the switch statement. |
Language: | C |
Severity Level: | 5 |
Category: | Statement and Blocks |
Description: |
Justification In the interest of readability. Example 1 switch (option) { default: /* WRONG */ /* any statement */ break; case 1: /* any statement */ break; } Example 2 switch (option) { case 1: /* RIGHT */ /* any statement */ break; default: /* any statement */ break; } |