[PATCH] D75529: [analyzer] Limit UCharMax to min of max uchar or max int

Vince Bridgers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 3 09:40:15 PST 2020


vabridgers marked 2 inline comments as done.
vabridgers added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:514
+  // Set UCharMax to min of int or uchar maximum value.
+  // The C standard states that functions like isalpha must be representable
+  // as an unsigned char. Their type is 'int', so the max value of the
----------------
martong wrote:
> Perhaps it would be more precise to refer to the argument of these functions. So `The C standard states that the arguments of functions like isalpha must be representable ...`
Will do. 


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:517
+  // argument should be min(UCharMax, IntMax). This just happen to be true
+  // for commonly used and well tested ISAs, but not for others. 
+  const RangeInt UCharMax = std::min(
----------------
martong wrote:
> Could you please spell out `ISA`? Maybe it is just me but I don't know what that stands for.
Yes, will do.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75529





More information about the cfe-commits mailing list