[cfe-dev] [analyzer] UninitializedObjectChecker evaluation

George Karpenkov via cfe-dev cfe-dev at lists.llvm.org
Mon Aug 13 11:15:16 PDT 2018


Hi,

I have recently evaluated the  (relatively recently developed, available with -Xclang -analyzer-checker=alpha.cplusplus.UninitializedObject)
UninitializedObjectChecker, which warns after the constructor call if any of the fields were left uninitialized.

Good news: I have found a few actual bugs
Bad news: Those bugs were hidden under hundreds of other reports

Most of the false alarms come from a case where a class is actually used as a union,
and a field is used to differentiate between those types.
Then unused types are simply left uninitialized.
Conceptually, this is not a correct design, but nevertheless, it is rather ubiquitous.

I have no idea whether we can work around this case, @Umann, any ideas there?

George



More information about the cfe-dev mailing list