[PATCH] D125400: [clang][Analyzer] Add errno state to standard functions modeling.

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 26 06:33:35 PDT 2022


martong added a comment.

Nice work, looks promising! Once this https://reviews.llvm.org/D125400?vs=431909&id=431924#inline-1206369 is addressed I will accept.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:2273
+    // here) may indicate failure. For this reason we do not enforce the errno
+    // check (can cause false positive).
     addToFunctionSummaryMap(
----------------
You mean the enforced errno check could cause false positive?


================
Comment at: clang/test/Analysis/errno-stdlibraryfunctions.c:20-24
+void test2() {
+  if (access("path", 0) == -1) {
+    if (errno != 0) { }
+  }
+}
----------------
steakhal wrote:
> 
+1 for @steakhal's recommendation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125400



More information about the cfe-commits mailing list