This is an archive of the discontinued LLVM Phabricator instance.

[analyzer][docs] Ellaborate the docs of cplusplus.StringChecker
ClosedPublic

Authored by steakhal on Nov 8 2021, 6:51 AM.

Details

Summary

Let's describe accurately what the users can expect from the checker in
a direct way.
Also, add an example warning message.

Diff Detail

Event Timeline

steakhal created this revision.Nov 8 2021, 6:51 AM
steakhal requested review of this revision.Nov 8 2021, 6:51 AM
Szelethus added inline comments.Nov 9 2021, 2:55 AM
clang/docs/analyzer/checkers.rst
322

You are not wrong, this just comes across too negative, and, pardon me, but pointlessly negative. I'd just spin this as "The current implementation only warns if an std::string was constructed from a null pointer".

324
327

I'd delete this as well. This should be implied by the documentation of the checker.

steakhal updated this revision to Diff 385778.Nov 9 2021, 4:32 AM
steakhal marked 3 inline comments as done.
steakhal added inline comments.
clang/docs/analyzer/checkers.rst
322

Hm, right.

Szelethus accepted this revision.Nov 9 2021, 5:25 AM

Maybe we should change the name of this checker to NullConstructedString or something, instead of piling even more different kinds of warnings into it in the future. Or maybe not. In any case, the patch LGTM!

This revision is now accepted and ready to land.Nov 9 2021, 5:25 AM
steakhal updated this revision to Diff 386085.Nov 10 2021, 1:14 AM

Add reference to the corresponding CERT rule.

martong accepted this revision.Nov 19 2021, 2:25 AM

LGTM!

Herald added a project: Restricted Project. · View Herald TranscriptNov 19 2021, 3:00 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript