03-11-2010, 09:38 AM
Rule 12.4 does not permit side-effects in the right hand operand of a logical operator or in the 2nd and 3rd operands of a conditional operator. The reason for this restriction is that the side-effect may or may not occur.
The method suggested by the previous poster is compliant with Rule 12.4 because the side-effect always occurs.
The method suggested by the previous poster is compliant with Rule 12.4 because the side-effect always occurs.
Posted by and on behalf of the MISRA C Working Group