30-05-2018, 08:54 PM
IMHO, both are technically sub-expressions.
It's either a mistake that the second one is compliant or the intent of MISRA was to add an explicit exception for declaration+initialization of block scope variables like i (x is not, so you have the side effect of changing its value + confusing it with ==).
Anyway, an official clarification would be nice.
It's either a mistake that the second one is compliant or the intent of MISRA was to add an explicit exception for declaration+initialization of block scope variables like i (x is not, so you have the side effect of changing its value + confusing it with ==).
Anyway, an official clarification would be nice.
<t></t>