Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 12.2 and "nested assignment statements"
#1
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"?
Reply
#2
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.
Posted by and on behalf of the MISRA C Working Group
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)