[PATCH] D122143: [clang][dataflow] Add support for disabling warnings on smart pointers.
Gábor Horváth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 21 08:36:42 PDT 2022
xazax.hun added a comment.
Are smart pointers special? I would expect to see similar problems with containers (or even a nested optional). I wonder whether an allowlist instead of a denylist approach is better here. E.g., instead of disabling the modeling for smart pointers, we could enable it for cases that we actually support (or alternatively, we could add a confidence value to the unsafe access). Usually, these checks are pretty robust when we deal with objects on the stack of the analyzed function (locals, parameters), but it is really hard to reason about objects from the outside (e.g., when a reference to an object is acquired from a container or smart pointer) unless we have explicit modeling for the APIs. The confidence approach might be useful as we are unlikely to cover all the custom smart pointers the users have.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122143/new/
https://reviews.llvm.org/D122143
More information about the cfe-commits
mailing list