Main reason for this change is that these checkers were implemented in the same class
but had different dependency ordering. (NonNullParamChecker should run before StdCLibraryFunctionArgs
to get more special warning about null arguments, but the apiModeling.StdCLibraryFunctions was a modeling
checker that should run before other non-modeling checkers. The modeling checker changes state in a way
that makes it impossible to detect a null argument by NonNullParamChecker.)
To make it more simple, the modeling part is removed as separate checker and can be only used if
checker StdCLibraryFunctions is turned on, that produces the warnings too. Modeling the functions
without bug detection (for invalid argument) is not possible. The modeling of standard functions
does not happen by default from this change on.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Ugh, yeah, so it has come to this. I championed my idea of granulalizing checkers into modeling and reporting components since what... 2018? I think the goal is still something to shoot for, but its time to admit that we the underlaying infrastructure needs to encourage that a lot more (and there is already so much dept in the form of these giant checkers).
I like the idea that the modeling portion and the reporting portion are in different checkers, but that is hard to achieve, when fatal errors by the sheer fact that they create sinkholes makes this practically impossible (we'd have to rewrite almost EVERY checker with that in mind, and also in way that it wont just require a branch). Even then, I'm not sure we would want that -- our checkers are not perfect, and yes, we sometimes do want to explicitly disable a non-alpha checker and everything that they do, including modeing because they are not working well on a project.
For how much I took a dump on checker silencing back in the day, I'm coming to terms with the fact that it is likely to be the most sustainable approach moving forward. Or, I don't know, the sheer size of these checkers really scream for some splitting up...
In any case, LGTM. I'm sure there are other ways around this, like creating an inner checker callback system inside this checker, but that sounds ridiculus, and its not like we can't do it after the fact.
Please grep the codebase for apiModeling.StdCLibraryFunctionsChecker to find other references to the now removed checker. Do the docs need any adjustment?
I think I'm also for this change.
I also wonder why we can't enable posix modeling by default. If we still can't, then when will we? Do you think it would make sense to enable them in the future?
There are still some problems with dependencies, the ErrnoChecker really needs now the StdCLibraryFunctions checker (to be turned on and run before) but this is not enforced. The checker order looks to work but not enforced specially.