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

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 25 01:53:46 PDT 2022


balazske added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:454-460
+      std::string Result = "Assuming that function '";
+      Result.append(FunctionName.str());
+      Result.append("' fails, in this case the value 'errno' becomes ");
+      Result.append(BinaryOperator::getOpcodeStr(Relation).str());
+      Result.append(" 0 and ");
+      Result.append(describeErrnoCheckState(CheckState));
+      return Result;
----------------
steakhal wrote:
> I believe you should use `Twine` for this.
It should work, `FunctionName.str()` and `getOpcodeStr` and `describeErrnoCheckState` should return non-temporary strings.


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