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

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 26 00:21:18 PDT 2023


Szelethus added a comment.

In D152436#4443858 <https://reviews.llvm.org/D152436#4443858>, @balazske wrote:

> In D152436#4438956 <https://reviews.llvm.org/D152436#4438956>, @NoQ wrote:
>
>> I'm somewhat skeptical of the decision made in D151225 <https://reviews.llvm.org/D151225> because the entire reason I originally implemented `StdCLibraryFunctions` was to deal with false positives I was seeing. It was really valuable even without the bug-finding part. So I really wish we could find some way to keep bug-finding and modeling separate.
>
> The problem was that modeling and report generation could not be separated correctly. Both are implemented in one class but are differently named checkers that should run in a specific order because dependency issues, this was not good.

In my view, it would certainly be possible through enormous efforts to further granularize this checker (or these large ones in general), so that the modeling and reporting portions would could be cleanly separated into their own checker objects. That certianly was my belief a couple years back -- I sank months and months into `MallocChecker`, yet I'm still not even close to that goal.

So, with the modeling and the reporting being the same entity, we can't express that some more specific checkers should run before it. `StreamChecker` can construct more specific messages thatn `StdLibraryFunctions` for a null stream object, but only if it runs ahead of it. That implies a both a weak and a strong dependency on what is essentially the same checker. As things stand, not sure how we could have avoided this if we want these checkers to finally leave the alpha state.

In D152436#4443828 <https://reviews.llvm.org/D152436#4443828>, @balazske wrote:

> For first experiment I have made patch D153612 <https://reviews.llvm.org/D153612> that adds a `NoteTag` to "all" standard function calls.

Could you post the results for it as you have them please?


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