AutosarC++18_10-A6.5.1

A for-loop that loops through all elements of the container and does not use its loop-counter shall not be used

Required inputs: IR

Possible Messages

Key

Text

Severity

Disabled

could_be_range_based

For loop could be a range-based for loop.

None

False

unused_loop_counter

For loop does not use its loop counter.

None

False

Options

exclude_simple_for_loops

exclude_simple_for_loops : bool = True

If set to true, this rule will not report unused loop counters in the simple cases where the C for-loop only references loop-counters in its condition but no other variables.
 

loop_counter_model

loop_counter_model

Type: LoopCounterModel

Default: 'misra_cpp_2008'

The loop counter model on which the analysis is based.
 

Option Types

These types are used by options listed above:

LoopCounterModel

An enumeration.
 
  • misra_c_2004

  • misra_c_2004_continue

  • misra_c_2012

  • misra_c_2012_continue

  • misra_cpp_2008

  • cert

  • generic