[PATCH] D152436: [clang][analyzer] Move checker alpha.unix.StdCLibraryFunctions out of alpha.

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 9 07:41:50 PDT 2023


balazske added a comment.

In D152436#4408301 <https://reviews.llvm.org/D152436#4408301>, @steakhal wrote:

> In D152436#4405558 <https://reviews.llvm.org/D152436#4405558>, @balazske wrote:
>
>> These are reports that could be improved:
>> link <https://codechecker-demo.eastus.cloudapp.azure.com/Default/report-detail?run=memcached_1.6.8_stdclibraryfunctions_test&is-unique=on&diff-type=New&checker-name=unix.StdCLibraryFunctions&report-hash=2bf08110160cdf74b43d1443a243c170&report-filepath=%2aauthfile.c&report-id=1930445>
>> In this case function `fileno` returns -1 because of failure, but this is not indicated in a `NoteTag`. This is a correct result, only the note is missing. This problem can be solved if a note is displayed on every branch ("case") of the standard C functions. But this leads to many notes at un-interesting places. If the note is displayed only at "interesting" values another difficulty shows up: The note disappears from places where it should be shown because the "interestingness" is not set, for example at conditions of `if` statement. So the solution may require more work. This case with function `fileno` occurs 13 times in all the tested projects.
>
> Could you elaborate on what do you mean by "The note disappears from places where it should be shown because the "interestingness" is not set, for example at conditions of `if` statement.".  A short example would do the job I think.
>
> I looked at the TPs, and if the violation was introduced by an assumption (instead of an assignment), then it's really hard to spot which assumption is important for the bug.
> I wonder if we could add the `TrackConstraintBRVisitor` to the bugreport to "highlight" that particular assumption/place.

The question is first if this problem must be fixed before the checker comes out of alpha state. If yes I try to make another patch with this fix. I tried this previously but do not remember exactly what the problem was.



================
Comment at: clang/docs/analyzer/checkers.rst:922
+
+unix.StdCLibraryFunctions (C)
+"""""""""""""""""""""""""""""
----------------
This is applicable to C++ too?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152436



More information about the cfe-commits mailing list