Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 13.4 For statement operand assignment
#2
The code does not violate rule 13.4 "The result of an assignment operator should not be used".

Examples of 13.4 violations would be 


Code:
x = pos = q; 
if ( pos = q );

However, the code does violate:

Rule 12.3  "The comma operator should not be used" which includes the 1st and 3rd clauses of a for loop

Rule 14.2  "A for loop shall be well-formed". This requires the use of a single loop counter with a scalar type.
Posted by and on behalf of the MISRA C Working Group


Messages In This Thread
RE: Rule 13.4 For statement operand assignment - by misra-c - 13-01-2022, 02:14 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)