[PATCH] D62885: [analyzer] Add werror flag for analyzer warnings

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 6 21:09:32 PDT 2019


NoQ added a comment.

Looks great! Feel free to add a Driver flag as well (i.e., --analyzer-werror or something like that) so that not to type `-Xclang` every time.

In D62885#1530573 <https://reviews.llvm.org/D62885#1530573>, @xazax.hun wrote:

> The only problem I see with this approach is that it is an all or nothing thing at the moment. Most of the checks in CSA can have false positives and people usually do not want to fail a build due to a false positive finding. This would force the users to do two separate passes with the static analyzer, one with the checks as errors enabled and one with the rest of the checks. The former run should not include any path sensitive checks as they are never free of false positives (due to the infeasible path problem).


It is a well-respected workflow to keep the codebase "analyzer-clean" (completely free of static analyzer warnings) at all costs. If you find true positives important enough, you'll be willing to suppress false positives as long as it allows you to address true positives as soon as they're introduced. It is also much cheaper to suppress false positives as you trigger them than to occasionally dig and triage. And it's a straightforward way to never look at the same false positive twice.


Repository:
  rC Clang

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

https://reviews.llvm.org/D62885





More information about the cfe-commits mailing list