[PATCH] D75697: [analyzer] Allow null false positive suppression for conditions

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 5 11:33:25 PST 2020


NoQ added a comment.

Aha! We need some positive results tho, given that these are heuristics.



================
Comment at: clang/test/Analysis/inlining/inline-defensive-checks.m:113
   if (!mem)
-    return 5/zero; // expected-warning {{Division by zero}}
+    return 5/zero;
   return 0;
----------------
This code definitely deserves a warning tho. Regardless of any path-sensitive reasoning, it's trivial to prove that either this line has a division by zero or it's outright dead code. I'd leave a FIXME here. This shouldn't be suppressed.

More importantly, we should have more tests to demonstrate how this patch is useful. I.e., some code snippets in which it's obvious that the suppressed warning is a false positive.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75697/new/

https://reviews.llvm.org/D75697





More information about the cfe-commits mailing list