<div style="font-family: arial, helvetica, sans-serif"><font size="2"><div class="gmail_quote">On Mon, Jun 18, 2012 at 8:37 AM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Chandler,<br>
<div class="im"><br>
> The codebase already has piles of these incorrect warnings in it,<br>
<br>
</div>maybe clang does but LLVM proper does not, so why not keep it that way?</blockquote><div><br></div><div>Because the warning is broken. Fundamentally.</div><div><br></div><div>There is no way to work around the warning that does not make the code worse. If the GCC optimizer cannot *prove* that the value is initialized, or does not hit one of its magical "don't warn on this" signals (usually escaped address to an external function), it calls it uninitialized.</div>
<div><br></div><div>If you initialize it blindly, then any actual bug you might have in your code will fail to be reported by Valgrind and other tools that really can detect uninitialized uses.</div><div><br></div><div>Now, maybe I've introduced a bug into this code and the warning is legitimate. I'll look into that. But I am completely opposed to changing code to be less readable, less accurate, less efficient, or less easy for Valgrind to check to satisfy a poorly implemented warning when we have better alternatives.</div>
<div><br></div><div>We should rely on Clang's -Wuninitialized and on Valgrind to catch our bugs.</div><div>-Chandler</div></div></font></div>