Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
For Loop: must update expression use only invariants?
#1
MISRA C:2012 Rule 14.2 puts the following restriction on the "third clause" (called "expression" in C++:2008):

Shall not use objects that are modified in the for loop body.

For example, the following violates this rule:
[code]
for (int i=0; i
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)