[CPP-434] Squelch query alerts if ALL files were compiled

with `-fwrapv` or `-fno-strict-overflow`
This commit is contained in:
Ziemowit Laski
2019-11-07 16:40:03 -08:00
parent 217ecd3551
commit 4ea8569081

View File

@@ -23,5 +23,9 @@ where
globalValueNumber(expr1) = globalValueNumber(expr2) and
add.getUnspecifiedType().(IntegralType).isSigned() and
not exists(MacroInvocation mi | mi.getAnAffectedElement() = add) and
exprMightOverflowPositively(add)
exprMightOverflowPositively(add) and
exists(Compilation c | c.getAFileCompiled() = ro.getFile() |
not c.getAnArgument() = "-fwrapv" and
not c.getAnArgument() = "-fno-strict-overflow"
)
select ro, "Testing for signed overflow may produce undefined results."