![]() |
![]() |
0594 | ![]() |
||||
![]() | |||||||
| Switch statements | |||||||
A negative case label has been found in a switch statement in which the controlling expression is of an unsigned type. The case label will probably be unreachable. For example:
/*PRQA S 2017 ++*/
/*PRQA S 2017,3227,3352,3408,3447,3605 ++*/
extern int x;
void foo(unsigned int n)
{
switch ( n )
{
case -1: /* Messages 0594 and 0277*/
++x;
break;
default:
--x;
break;
}
}
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |