<div class="gmail_quote">On Wed, Feb 29, 2012 at 1:38 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Wed, Feb 29, 2012 at 1:22 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:<br>
> I really would like to avoid silencing the GCC "may be used uninitialized"<br>
> warnings by introducing unnecessary initialization.<br>
><br>
> These warnings are almost always false positives due to the way the warning<br>
> was implemented. What it means is that GCC has been unable to *prove*<br>
> initialization took place, and has not hit one of a (very short) list of<br>
> known impossible cases. This warning was bad enough that we (Google) lobbied<br>
> upstream and I believe it is now under a separate flag from -Wuninitialized.<br>
><br>
> Every time we add initializations like this we achieve three things:<br>
><br>
> 1) placate a fundamentally flawed warning<br>
> 2) slow down code in some cases (the ability to eliminate the initialization<br>
> corresponds to when this warning *doesn't* fire)<br>
> 3) prevent us from ever getting Valgrind errors if we in fact introduce a<br>
> bug leaving the variable uninitialized.<br>
><br>
> It is #3 that makes me really bothered by the spirit of these changes. I<br>
> would like to recommend anyone using an older GCCs should simply disable<br>
> -Wuninitialized.<br>
<br>
</div>Should we add some handling for this in the LLVM build if that's the<br>
case/achievable/sufficiently useful?</blockquote><div><br></div><div>While I'm not personally motivated to add this (I think most developers should self-host most of the time, turning off -Werror in the bootstrap phase isn't a burden then), I'm not opposed to it and would be happy to review patches to that effect.</div>
</div>