![]() |
![]() |
2996 | ![]() |
||||
![]() | |||||||
| Invariant operations | |||||||
The result of this logical operation is always 'false' (0). The fact that this expression is "degenerate" suggests a logical flaw in the code. For example:
/*PRQA S 2017,2100,3120,2982,2983,2984,2986,3198,3199,3203,3227,3356,3408 ++*/
void foo(unsigned char x, int y)
{
int r;
r = x > 300; /* 2996 */
if (y < 20)
{
r = y > 30; /* 2996 */
}
}
MISRA C:2012 Rules applicable to message 2996:
| Rule-2.2 (Required) | There shall be no dead 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 |