[cfe-dev] [analyzer] UninitializedObjectChecker evaluation
George Karpenkov via cfe-dev
cfe-dev at lists.llvm.org
Fri Aug 31 14:28:10 PDT 2018
> On Aug 28, 2018, at 5:04 AM, Kristóf Umann <dkszelethus at gmail.com> wrote:
> >> * We could find the discriminators using name conventions just as Kristóf mentioned
I think that’s a good idea, and we could not warn if the class has fields called mode/kind/type/etc.
Another hack I was thinking about:
- Check *syntactically* whether there is an *unguarded* access to uninitialized fields in equality/assignment/destructor operators.
Or maybe unguarded access in general.
This is checkable syntactically and provides a fairly strong indicator of a bug.
I wish we had dataflow for that, but we don’t =/
> >> * Suppress reports from classes with most of their fields being uninitialized. This is a threshold kind of thing that is unpopular to some since some could could bounce back and forth around the threshold.
I don’t think this will work well.
It also provides a very counter-intuitive behavior, as you have mentioned.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev