![]() |
![]() |
2744 | ![]() |
||||
![]() | |||||||
| Invariant operations | |||||||
The value of the controlling expression in this 'while' or 'for' statement is a constant expression with zero (i.e. 'false') value. The code within the loop is therefore unreachable. For example:
/*PRQA S 2017,3201,3325,3447,3408 ++*/
#define AM 5
#define BM 7
extern int y;
void foo(void)
{
while (AM > BM) /* 2744 */
{
++y; /* 2880 */
}
}
MISRA C:2012 Rules applicable to message 2744:
| Rule-2.1 (Required) | A project shall not contain unreachable code |
See also:
![]() | ||
| 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 |