Fall-through in switch cases is often considered risky.
Hence consider adding an unconditional break
for each switch clause.
You may want to ignore this issue if your code-style makes extensive use of fall-through pattern.
int main() {
switch (1) {
case 0: {
// [fallthrough]
};
case 1: {
// [fallthrough]
};
case 2: {
// ..
} break;
default: {
// ..
}
}
}
int main() {
switch (1) {
case 0: {
// ..
} break;
case 1: {
// ..
} break;
case 2: {
// ..
} break;
default: {
// ..
}
}
}