NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.
Nice! These are indeed useful when multiple things can happen. You may also
consider adding stack hints a-la `MallocChecker` (i.e., "Returning; handle was
closed").
================
Comment at: clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp:322
// Function returns an open handle.
if (hasFuchsiaAttr<AcquireHandleAttr>(FuncDecl)) {
----------------
I think this commend would have actually made a better note text. Maybe mention
the function name as well, "Function foo() returns an open handle".
================
Comment at: clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp:359
+ llvm::raw_string_ostream OS(SBuf);
+ OS << "Handle released at " << ParamDiagIdx
+ << llvm::getOrdinalSuffix(ParamDiagIdx) << " parameter.";
----------------
I think we often use "through" in this context. I.e., "Handle released through
2nd parameter".
================
Comment at: clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp:363
} else
- return "";
+ return std::string{};
});
----------------
What was wrong with good old `""`?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73229/new/
https://reviews.llvm.org/D73229
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits