Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 14.2 What is meant by assign"
#1
In the 1st clause what is meant by “assign a value to the loop counter”. May this “value” be an expression with side-effects?
Code:
int index;
for ( set_val(&index) ;  index < 10 ; index++) // Is this compliant if set_val assigns to index
Note: the 2nd and 3rd clauses explicitly refer to expressions and whether side-effects are permitted.
Posted by and on behalf of the MISRA C Working Group


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)