[PATCH] D45532: [StaticAnalyzer] Checker to find uninitialized fields after a constructor call

Umann Kristóf via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 4 03:46:17 PDT 2018


Szelethus marked 5 inline comments as done.
Szelethus added a comment.

In https://reviews.llvm.org/D45532#1116992, @george.karpenkov wrote:

> @Szelethus I personally really like this idea, and I think it would be a great checker.
>  Could you perform more evaluation on other projects?


Thanks for the encouraging words!

I have checked some other projects:

- Xerces: I only found one uninit field (shockingly), and I found that it was probably unintentional.
- grpc: This project depends on numerous third-party libraries, so it has a variety of coding and implementation styles. The checker emitted 5 warnings, and I think it's very likely that at least 3 of those were unintentional (4, if we count the missing `=default;`).
- CppCheck: No warnings at all :)

The checker didn't crash during the analysis of any of the projects.

After some thinking, I decided to mark the comments on base classes done. I believe that the current implementation results in the best user experience, but even if we were come to the conclusion that it is not, we could resume the conversation on this when I submit a patch to fix related issues within `isCalledByConstructor`.


https://reviews.llvm.org/D45532





More information about the cfe-commits mailing list