<div class="gmail_extra"><div class="gmail_quote">On Sun, Apr 22, 2012 at 12:37 AM, Bill Wendling <span dir="ltr"><<a href="mailto:isanbard@gmail.com" target="_blank">isanbard@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 Apr 22, 2012, at 12:34 AM, Chandler Carruth wrote:<br>
<br>
> On Sun, Apr 22, 2012 at 12:23 AM, Bill Wendling <<a href="mailto:isanbard@gmail.com">isanbard@gmail.com</a>> wrote:<br>
> Author: void<br>
> Date: Sun Apr 22 02:23:04 2012<br>
> New Revision: 155307<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=155307&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=155307&view=rev</a><br>
> Log:<br>
> Remove some potential warnings about variables used uninitialized.<br>
><br>
> I'm not thrilled with this change. I know that GCC has a broken uninitialized variable warning, but I don't think we should silence it this way. When we initialize these variables unnecessarily, we lose the ability to track actual bugs with tools like Valgrind.<br>

><br>
> Do these warnings really cause any problems? Newer GCC versions can turn them off with -Wno-maybe-uninitialized, and they're off in Clang for the same reason...<br>
<br>
</div>The .getAsInteger methods can return without assigning a value to the variable, so those seem like legitimate errors.</blockquote><div><br></div><div>But the fix should be quite different I suspect -- given the TODO on the previous line to actually report an error in other cases we should probably do the same here.</div>
<div><br></div><div>And we probably need some more test cases so that Valgrind would actually detect this error in the future.</div><div><br></div><div>I've CC'ed Michael who should probably look at this.</div><div>
 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> The only one I would question is the Mips fix, which seems rather odd that it could get past the switch statement without assigning a value to the variable.<br>
</blockquote><div><br></div><div>This is likely because while the switch "covers" the enumerators, GCC's warning uses the strict interpretation of an enum's range of possible values. This is also why GCC's -Wreturn-type fires if we don't put the 'llvm_unreachable(...)' after covering switches where each case returns...</div>
</div></div>