![]() |
![]() |
4108 | ![]() |
||||
![]() | |||||||
| Arithmetic type - Operands | |||||||
The left hand operand of this logical AND (&&) or logical OR (||) operator is derived from a bitwise or arithmetic operator. This is probably a mistake; perhaps a bitwise AND (&) or bitwise OR (|) was intended ? For example:
/*PRQA S 2017,3198,3199,3203,3227,3408 ++*/
extern void foo(unsigned int a, unsigned int b, unsigned int c)
{
int r;
r = (a + b) && c; /* Message 4108 */
r = (a + b) || c; /* Message 4108 */
}
No MISRA C:2012 Rules applicable to message 4108
![]() | ||
| 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 |