[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 7 11:35:34 PST 2024


whisperity wrote:

> Is there no way to mark new/experimental checks so that they are off by default?

@ymand At some point in the past, albeit several years ago, I had worked on a check (not with the data-flow framework!) which was originally on track to be introduced as such an *experimental* check. See https://reviews.llvm.org/D76545. The idea was that similarly to `alpha.` checkers in **CSA** we could add an `experimental-`. The biggest counter-argument is that there is no good policy for when something can be put in as experimental, and we don't have a consensus as to how long something can stay experimental, how experimental things are dropped, or promoted into non-experimental checkers, etc. **CSA** has several alpha checkers (some have been there for almost a decade now!), and some of my colleagues are working hard on improving them.

As of some 18.0 version, Clang-Tidy by default enables **no** checkers apart from those "inherited" from **CSA**. At least calling a raw `clang-tidy --list-checks` only gives back `clang-analyzer-` ones...

@PiotrZSL For interactive users, we have added the new check to the list of forbidden checks that are auto-enabled through clangd. Just like how the optional checker is on that list.

https://github.com/llvm/llvm-project/pull/84166


More information about the cfe-commits mailing list