Fix S2589 FP: Unsigned number doubling by adding with itself inside while loop #9184
Labels
Area: CFG/SE
CFG and SE related issues.
Type: False Positive
Rule IS triggered when it shouldn't be.
Description
S2589 is being reported when using unsigned
x += x
.Repro steps
Expected behavior
No issue should be found.
Actual behavior
u > 0
gets S2589Known workarounds
Use either
u *= 2;
oru <<= 1;
instead ofu += u;
.Related information
The text was updated successfully, but these errors were encountered: