13-05-2022, 02:01 PM
You are right, your example does violate A5-4-1, and this is probably an oversight in the drafting.
As far as A5-16-1 is concerned, the last line of foo() is virtually the same as a compliant example, so Autosar was probably intending to include the ternary operator.
This is being reviewed for the next version of the rules.
As far as A5-16-1 is concerned, the last line of foo() is virtually the same as a compliant example, so Autosar was probably intending to include the ternary operator.
This is being reviewed for the next version of the rules.
Posted by and on behalf of
the MISRA C++ Working Group
the MISRA C++ Working Group