Closed nbusser-sr closed 2 days ago
Thanks! This should be relatively straight-forward to fix.
Note for future implementor, we need to modify Loops.qll
to change:
loopCounterAccess.isAddressOfAccess()
to
loopCounterAccess.isAddressOfAccessNonConst()
I think this one is fixed now.
Affected rules
M6-5-3
:cpp/autosar/loop-counter-modified-within-statement
or statement.
Description
When passing a loop counter to a function as const ref,
M6-5-3
is triggered.NB: It is also triggered when passed as a mutable ref, but the function never uses the ref. This is less problematic since you should not give a mutable ref argument which is never modified.
Example