We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 217ecd3 commit 4ea8569Copy full SHA for 4ea8569
cpp/ql/src/Likely Bugs/Arithmetic/SignedOverflowCheck.ql
@@ -23,5 +23,9 @@ where
23
globalValueNumber(expr1) = globalValueNumber(expr2) and
24
add.getUnspecifiedType().(IntegralType).isSigned() and
25
not exists(MacroInvocation mi | mi.getAnAffectedElement() = add) and
26
- exprMightOverflowPositively(add)
+ exprMightOverflowPositively(add) and
27
+ exists(Compilation c | c.getAFileCompiled() = ro.getFile() |
28
+ not c.getAnArgument() = "-fwrapv" and
29
+ not c.getAnArgument() = "-fno-strict-overflow"
30
+ )
31
select ro, "Testing for signed overflow may produce undefined results."
0 commit comments