Page MenuHomePhabricator

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

Authored by steakhal on Mon, Nov 8, 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.Mon, Nov 8, 6:51 AM
steakhal requested review of this revision.Mon, Nov 8, 6:51 AM
Szelethus added inline comments.Tue, Nov 9, 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.Tue, Nov 9, 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.Tue, Nov 9, 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.Tue, Nov 9, 5:25 AM
steakhal updated this revision to Diff 386085.Wed, Nov 10, 1:14 AM

Add reference to the corresponding CERT rule.

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

LGTM!

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