[PATCH] D74473: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 12 04:41:24 PST 2020


martong planned changes to this revision.
martong marked 3 inline comments as done.
martong added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:533
+
+    IntValue.dump();
+    return IntValue.getSExtValue();
----------------
balazske wrote:
> Debug message (to be removed)?
Thanks, good catch!


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:535
+    return IntValue.getSExtValue();
+  }();
 
----------------
balazske wrote:
> It would be good to have this function available generally to other checkers, the same functionality is needed in https://reviews.llvm.org/D72705 too.
> It could work with any (specified) macro name, there are other special values in API calls. But there can be more difficult cases if the EOF (or other) is not a simple value but another macro or constructed from values some way. (The `ULONG_MAX` and similar can be get in the same way.)
Ok, I am gonna put a generic version of this under `CheckerHelpers.h`, so all checkers can use it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74473





More information about the cfe-commits mailing list