Code statement look like below:
if((temp1 == ID1) || (temp2 == (C_UINT16) ID2))
{
}
I am not sure why QAC is generating this warning. What will be the side effect & how to avoid this warning.
Details for QAC-help:
The right hand operand of a logical && operator is only evaluated if
the left hand operand evaluates to 1 (“true”). The right hand operand
of a logical || operator is only evaluated if the left hand operand
evaluates to 0 (“false”).Because of this behaviour, confusion can arise if the right hand
operand of either of these operators generates side effects. Message
3415 is generated to identify such a situation.Side effects occur when an expression:
- accesses a volatile object
- executes an increment, decrement, assignment or compound assignment
operation - performs I/O or
- calls a function which does any of the above
However QAC assumes that side effects occur whenever a function is
called, unless the function has specifically been identified as being
free from side effects by a #pragma statement of the form:
#pragma PRQA_NO_SIDE_EFFECTS funcname
You need to sign in to view this answers
Leave feedback about this