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