![]() |
![]() |
0571 | ![]() |
||||
![]() | |||||||
| Switch statements | |||||||
This message is issued whenever a switch controlling expression and a case constant expression have the same essential type category, but the controlling expression is of higher rank. Specifically, the message is only issued then the former if of rank long long, and the later of rank long. Consider using an 'LL' (respectively 'ULL') suffix to match the rank of both expressions, or not using a suffix at all. For example:
/*PRQA S 1-9999 ++*/
/*PRQA S 0571 --*/
/********************************
* OPTIONS: -ex LONGLONG
*******************************/
void f0571 (long long a)
{
switch (a)
{
case 0L: /* Message 0571 */
case (long) 1: /* Message 0571 */
case 2: /* OK */
case 3LL: /* OK */
break;
default:
break;
}
}
No MISRA C:2012 Rules applicable to message 0571
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index | Contents |