A4-7-1
: false positives in for loops
#798
Labels
Difficulty-High
A false positive or false negative report which is expected to take 1+ week effort to address
false positive/false negative
An issue related to observed false positives or false negatives.
Impact-Medium
Standard-AUTOSAR
Affected rules
A4-7-1
Description
Typical increment by one in for loops cannot lead to overflow or wrap-around because the number of iterations isn't large enough. The example illustrates true negatives together with false positives:
f
the variable used as "loop counter" is defined inside or outside the scope of the loop,g
the number of iterations changes by a factor 100, although still not close to int limit - in general I think a query should take into account, if possible, the value used to initialize the counter and the (potential maximum) number of iterations.Example
The text was updated successfully, but these errors were encountered: