From: NAKAMURA Takumi Date: Sat, 8 Oct 2011 11:31:53 +0000 (+0000) Subject: Fix "Uninitialized" warnings. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96e21710e8bf64514ca7d3720cb3b2823eec9164;p=clang Fix "Uninitialized" warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141487 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 1914fff0dd..0f9f471790 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -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 First = VersionText.split('.'); std::pair 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; diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index 7754c9855d..22a1eb3744 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -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;