Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 9.5.1 - Missing definitions
#2
The definitions were intended to be taken from the rule text, so the first three lines of the amplification:
   "The init-statement only declares and initializes a loop-counter of integer type; and
    The condition only compares the loop-counter to a loop-bound using a relational operator; and
    The loop-counter is modified, but only by incrementing or decrementing by a loop-step within the expression of the for statement; and ..."

(where init-statement, condition and expression are C++ terms, see #9.5.3)  

were intended to be read as:
    The init-statement only declares and initializes an object of integer type, known as the 'loop-counter'; and
    The condition only compares the loop-counter to an expression (known as the 'loop-bound') using a relational operator; and
    The loop-counter is modified, but only by incrementing or decrementing by a value within the expression of the for statement, known as the 
    'loop-step '; and ..."

We agree that this could be clearer.  We believe that this is equivalent to the rule in 2008
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Messages In This Thread
Rule 9.5.1 - Missing definitions - by cgpzs - 02-12-2025, 08:55 AM
RE: Rule 9.5.1 - Missing definitions - by misra cpp - 05-12-2025, 01:25 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)