M6-5-3
: Triggered when loop counter is passed as const ref
#755
Labels
Difficulty-Low
A false positive or false negative report which is expected to take <1 day effort to address
false positive/false negative
An issue related to observed false positives or false negatives.
Impact-Medium
Standard-AUTOSAR
user-report
Issue reported by an end user of CodeQL Coding Standards
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
The text was updated successfully, but these errors were encountered: