22-09-2010, 07:52 AM
The last sentence of the first paragraph of Rule 12.5 reads:
Therefore the code is compliant with Rule 12.5.
Your tool appears to be checking correctly against the headline rule (the extra parentheses make the right operand of the first || into a primary expression) but has not taken the whole text of the rule into account.
Quote:Where an expression consists of either a sequence of only logical && or a sequence of only logical || , extra parentheses are not required.
Therefore the code is compliant with Rule 12.5.
Your tool appears to be checking correctly against the headline rule (the extra parentheses make the right operand of the first || into a primary expression) but has not taken the whole text of the rule into account.
Posted by and on behalf of the MISRA C Working Group