Why is this an issue?
The GNU compiler extension that allows case
s to be specified with ranges will only recognize ranges specified from a smaller value to
a larger value. Flip the order and the range will evaluate as empty.
Noncompliant code example
switch (i) {
case 0:
//...
break;
case 1 ... 2:
//...
break;
case 5 ... 3: // Noncompliant
//...
break;
Compliant solution
switch (i) {
case 0:
//...
break;
case 1 ... 2:
//...
break;
case 3 ... 5
//...
break;