[PATCH] D28543: Elliminates uninitialized warning for volitile varibles.
Nico Weber via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 11 15:00:36 PST 2017
thakis added a comment.
Thanks, this is looking pretty good! From clicking around a bit on cs, do you think it's better to put the check where you have it, or is maybe http://llvm-cs.pcc.me.uk/tools/clang/lib/Analysis/UninitializedValues.cpp#36 more appropriate? I think having it where you have it means saying "we can reason about volatile vars, and we want to treat them as initialized" while the other spot means "we can't reason about volatile variables at all". I don't know which place is better (of someone else reading this knows, please speak up). If the other place makes your test fail, having the check where you have it is probably fine. Else I'd say that moving the check up is probably better.
Comment at: clang/lib/Analysis/UninitializedValues.cpp:763
// int x = x;
No idea what should happen with `volatile int x = x` -- but I've never seen that in practice, so it probably doesn't matter too much either way.
More information about the cfe-commits