[PATCH] D25940: [analyzer] LibraryFunctions: Fix errors due to different integral types and typedefs on different architectures.

Devin Coughlin via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 25 16:53:54 PDT 2016


dcoughlin added a comment.

Are the parameter types actually needed? I think in general the rest of the analyzer uses arity alone.

Is the idea to allow for overloads in C++? If so, then I think this equivalent-up-to-size-and-sign approach will disallow those overloads.



================
Comment at: lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:393
 
+bool StdLibraryFunctionsChecker::FunctionSummaryTy::typesAreEqual(
+    QualType Lhs, QualType Rhs, ASTContext &ACtx) {
----------------
Maybe this should be named something like "typesMatch" since it is not actually return whether the types are equal?


================
Comment at: lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:418
+
+  return ACtx.getTypeSize(Lhs) == ACtx.getTypeSize(Rhs);
+}
----------------
If the problem is only for ssize_t, would it make sense to only do this if both the lhs and rhs are signed?

Another possibility is to have an lhs of what we think is the ssize_t type match any signed type.


https://reviews.llvm.org/D25940





More information about the cfe-commits mailing list