sqc 0.4.13

Software Code Quality - CERT C compliance checker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Test: code after switch-with-break is reachable

#include <stdio.h>

void classify(int x) {
    switch (x) {
    case 0:
        printf("zero\n");
        break;
    case 1:
        printf("one\n");
        break;
    default:
        printf("other\n");
        break;
    }
    printf("done\n");  // reachable after switch
}