[PATCH] D135247: [clang][analyzer] Add stream functions to StdLibraryFunctionsChecker.

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 6 07:08:04 PST 2022


balazske added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:786
   /// constraints (and different return value constraints).
-  const NoErrnoConstraint ErrnoIrrelevant{};
+  const NoErrnoConstraint ErrnoUnchanged{};
+  const ResetErrnoConstraint ErrnoIrrelevant{};
----------------
Szelethus wrote:
> Hmm, do we need to specify this? Can't this be the default?
This is only used in cases where `errno` should not change (previous value remains, no invalidation happens). This works if another checker has `evalCall` for the function and does not change `errno` (otherwise a default evaluation occurs that invalidates the system region of `errno`).
The `StreamChecker` is an example with some functions added in the next patch. This class is really not used in this patch, could be moved to the next.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135247



More information about the cfe-commits mailing list