PREfast Warning 259 (Windows CE 5.0)
259 - Labeled code is unreachable.
Additional Information: <expression> & <constant> in switch-expr limits case values to a maximum of <constant>.
This warning indicates dead code caused by a mask operation in a switch expression.
The related case statements that exceed the constant are not reachable.
Example
Defective Source
switch (rand () & 3) {
case 3:
// Reachable
break;
case 4:
// Not reachable
break;
default:
break;
}
Corrected Source
switch (rand () & 3) {
case 3:
// Reachable
break;
default:
break;
}
Send Feedback on this topic to the authors