Page MenuHomePhabricator

[Analyzer] Add docs to StdCLibraryFunctionArgsChecker

Authored by martong on Jan 18 2022, 8:48 AM.

Diff Detail

Event Timeline

martong created this revision.Jan 18 2022, 8:48 AM
martong requested review of this revision.Jan 18 2022, 8:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2022, 8:48 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
NoQ added inline comments.Jan 18 2022, 2:02 PM

I recommend against using clang_analyzer_eval in user docs. Users aren't expected to know what it is.


Nitpick: the program doesn't become ill-formed just because the user has turned off the checker. Maybe it's better to say that exploring an execution path that already contains undefined behavior is not valuable, or something along those lines(?)

I like it. Terse but complete.
I think you could polish the example code to look less synthetic.

dkrupp added inline comments.Jan 19 2022, 4:25 AM

I think it would be useful for the user to see one example per constraint type that this checker supports.
RangeConstraint (was covered), ComparisonConstraint, ValueConstraint, Not null Constraint, BufferSize constraint etc.

It would be also nice to add a section "Limitations".

Describe there well known false positive cases or limitations in the bug diagnostics that limits understandability.
Essentially the most important well known cases why this checker is alpha.

This section would be useful for users to understand and help identifying cases that are known false positives and for the developers to know how to improve this checker. I remember many cases when we had to test multiple times "why a checker is in alpha", because we forgot about it. I think it is best to document it.

martong updated this revision to Diff 401230.Jan 19 2022, 7:13 AM
martong marked 3 inline comments as done.
  • Describe the different kind of constraints and limitations
  • Some rewording

Ok, I've changed to have an infeasible branch condition and below that an unreported div zero warning demonstrates the same.


Ok, I've changed the wording.


Ok, I've added a few paragraphs to describe these things.

dkrupp accepted this revision.Jan 19 2022, 8:43 AM
This revision is now accepted and ready to land.Jan 19 2022, 8:43 AM
steakhal accepted this revision.Jan 20 2022, 10:39 AM

Looks great.

This revision was automatically updated to reflect the committed changes.