The requirement for a final default
clause is defensive programming. The clause should either take appropriate action, or contain a
suitable comment as to why no action is taken.
Noncompliant code example
switch tag { // Noncompliant - default case is missing
case 0, 1, 2, 3:
foo()
case 4, 5, 6, 7:
bar()
}
Compliant solution
switch tag {
case 0, 1, 2, 3:
foo()
case 4, 5, 6, 7:
bar()
default:
qix()
}