[PATCH] D63915: [analyzer] ReturnValueChecker: Model the guaranteed boolean return value of function calls

Csaba Dabis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 2 17:34:33 PDT 2019


Charusso added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/ReturnValueChecker.cpp:120
+            << (Value ? "true" : "false")
+            << " according to the LLVM coding standard, but it returns "
+            << (Value ? "false" : "true");
----------------
NoQ wrote:
> LLVM coding standard is a fairly specific document: https://llvm.org/docs/CodingStandards.html . It doesn't seem to say anything about parsers.
> 
> Let's make this much softer: `Parser::Error() returns false` and that's it.
> 
> Also given that this note always applies to inlined calls, let's move this logic to `checkEndFunction()`. I.e., we emit the "false" note in `checkEndFunction` but we emit the "true" note in `checkPostCall`.
Well, we have tons of unspoken standards like: `MR, DRE, SE, RD, V`.... all makes sense, but I like your idea more.


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

https://reviews.llvm.org/D63915





More information about the cfe-commits mailing list