<div class="gmail_quote">On Sun, Apr 22, 2012 at 12:23 AM, Bill Wendling <span dir="ltr"><<a href="mailto:isanbard@gmail.com">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">
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></blockquote><div><br></div><div>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.</div>
<div><br></div><div>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...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Modified:<br>
    llvm/trunk/lib/Support/YAMLParser.cpp<br>
    llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp<br>
<br>
Modified: llvm/trunk/lib/Support/YAMLParser.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/YAMLParser.cpp?rev=155307&r1=155306&r2=155307&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/YAMLParser.cpp?rev=155307&r1=155306&r2=155307&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/lib/Support/YAMLParser.cpp (original)<br>
+++ llvm/trunk/lib/Support/YAMLParser.cpp Sun Apr 22 02:23:04 2012<br>
@@ -1732,7 +1732,7 @@<br>
           if (UnquotedValue.size() < 3)<br>
             // TODO: Report error.<br>
             break;<br>
-          unsigned int UnicodeScalarValue;<br>
+          unsigned int UnicodeScalarValue = 0;<br>
           UnquotedValue.substr(1, 2).getAsInteger(16, UnicodeScalarValue);<br>
           encodeUTF8(UnicodeScalarValue, Storage);<br>
           UnquotedValue = UnquotedValue.substr(2);<br>
@@ -1742,7 +1742,7 @@<br>
           if (UnquotedValue.size() < 5)<br>
             // TODO: Report error.<br>
             break;<br>
-          unsigned int UnicodeScalarValue;<br>
+          unsigned int UnicodeScalarValue = 0;<br>
           UnquotedValue.substr(1, 4).getAsInteger(16, UnicodeScalarValue);<br>
           encodeUTF8(UnicodeScalarValue, Storage);<br>
           UnquotedValue = UnquotedValue.substr(4);<br>
@@ -1752,7 +1752,7 @@<br>
           if (UnquotedValue.size() < 9)<br>
             // TODO: Report error.<br>
             break;<br>
-          unsigned int UnicodeScalarValue;<br>
+          unsigned int UnicodeScalarValue = 0;<br>
           UnquotedValue.substr(1, 8).getAsInteger(16, UnicodeScalarValue);<br>
           encodeUTF8(UnicodeScalarValue, Storage);<br>
           UnquotedValue = UnquotedValue.substr(8);<br>
<br>
Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp?rev=155307&r1=155306&r2=155307&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp?rev=155307&r1=155306&r2=155307&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp (original)<br>
+++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp Sun Apr 22 02:23:04 2012<br>
@@ -194,7 +194,7 @@<br>
<br>
   assert (Kind == MCExpr::SymbolRef);<br>
<br>
-  Mips::Fixups FixupKind;<br>
+  Mips::Fixups FixupKind = Mips::Fixups(0);<br>
<br>
   switch(cast<MCSymbolRefExpr>(Expr)->getKind()) {<br>
   case MCSymbolRefExpr::VK_Mips_GPREL:<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br>