[PATCH] D72705: [analyzer] Added new checker 'alpha.unix.ErrorReturn'.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 11 13:14:06 PDT 2020


NoQ added a comment.

In D72705#1871996 <https://reviews.llvm.org/D72705#1871996>, @Szelethus wrote:

> @NoQ, @xazax.hun, @baloghadamsoftware, how do you like this patch? I think the high level idea is correct.


I still don't understand how do we enable this checker, i.e. for whom and how often. Is there anything we'll be able to turn on by default, like maybe warn on all functions that wear `__attribute__((warn_unused_result))`?



================
Comment at: clang/lib/StaticAnalyzer/Checkers/ErrorReturnChecker.cpp:309-311
+void ErrorReturnChecker::checkAccess(CheckerContext &C, ProgramStateRef State,
+                                     const Stmt *LoadS, SymbolRef CallSym,
+                                     const CalledFunctionData *CFD) const {
----------------
Why scan parent statements proactively given that we will reach them later anyway? Looks like you're using a wrong checker callback.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72705





More information about the cfe-commits mailing list