MISRA Discussion Forums

Full Version: Rule 12.2 and "nested assignment statements"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Example from mc2_1203.c:
Code:
mc2_1203_x = sizeof ( mc2_1203_a = 1234U );

Is this code also a violation of rule 12.2 "nested assignment statements"?
Code:
mc2_1203_x = sizeof ( mc2_1203_a = 1234U );
This is not a violation of Rule 12.2.
This is a violation of Rule 12.3.

mc2_1203_a = 1234U is not executed, so is not an assignment statement.