[PATCH] D30341: [analyzer] clarify error messages about uninitialized function arguments

Anna Zaks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 1 13:32:56 PST 2017


zaks.anna added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp:211
       // Generate a report for this bug.
-      StringRef Desc =
-          describeUninitializedArgumentInCall(Call, IsFirstArgument);
+      std::string Desc =
+          describeUninitializedArgumentInCall(Call, ArgumentNumber);
----------------
danielmarjamaki wrote:
> zaks.anna wrote:
> > Have you considered using  llvm::raw_svector_ostream here as well as passing it an argument to describeUninitializedArgumentInCall? For example, see  MallocChecker.cpp.
> I changed so describeUninitializedArgumentInCall() returns an llvm::Twine instead of std::string. hope you like it.
> 
I do not think it's safe to use llvm:Twine here. See http://llvm.org/docs/ProgrammersManual.html#the-twine-class

How about using llvm::raw_svector_ostream as I suggested?


Repository:
  rL LLVM

https://reviews.llvm.org/D30341





More information about the cfe-commits mailing list