]> granicus.if.org Git - clang/commitdiff
Fix "Uninitialized" warnings.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Sat, 8 Oct 2011 11:31:53 +0000 (11:31 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Sat, 8 Oct 2011 11:31:53 +0000 (11:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141487 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp
lib/Parse/ParseStmt.cpp

index 1914fff0dd7b59564eb57f98d9959111cd4c1af2..0f9f4717900f822bb55015f431edc3e337336923 100644 (file)
@@ -1511,11 +1511,11 @@ class GCCInstallationDetector {
     unsigned Major, Minor, Patch;
 
     static GCCVersion Parse(StringRef VersionText) {
-      const GCCVersion BadVersion = {};
+      const GCCVersion BadVersion = {0, 0, 0};
       std::pair<StringRef, StringRef> First = VersionText.split('.');
       std::pair<StringRef, StringRef> Second = First.second.split('.');
 
-      GCCVersion GoodVersion = {};
+      GCCVersion GoodVersion = {0, 0, 0};
       if (First.first.getAsInteger(10, GoodVersion.Major))
         return BadVersion;
       if (Second.first.getAsInteger(10, GoodVersion.Minor))
@@ -1605,7 +1605,7 @@ public:
 
     // Loop over the various components which exist and select the best GCC
     // installation available. GCC installs are ranked by version number.
-    GCCVersion BestVersion = {};
+    GCCVersion BestVersion = {0, 0, 0};
     for (unsigned i = 0, ie = Prefixes.size(); i < ie; ++i) {
       if (!PathExists(Prefixes[i]))
         continue;
index 7754c9855db4fb125c41977d183f114fd4cc94be..22a1eb3744b32081470d2bc0e88b23043d6668cf 100644 (file)
@@ -1579,10 +1579,10 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) {
   SourceLocation EndLoc = AsmLoc;
   do {
     bool InBraces = false;
-    unsigned short savedBraceCount;
+    unsigned short savedBraceCount = 0;
     bool InAsmComment = false;
     FileID FID;
-    unsigned LineNo;
+    unsigned LineNo = 0;
     unsigned NumTokensRead = 0;
     SourceLocation LBraceLoc;