diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2012-02-29 20:59:56 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2012-02-29 20:59:56 +0000 |
| commit | 381f431e28eb605b3138d2225f1eeea8da6abefe (patch) | |
| tree | 629e414bb84aae32e5b5a9599e4a2943a66ea227 /clang/lib | |
| parent | 0448d9fe2b9dd463e157323d56b382c23541fc49 (diff) | |
| download | bcm5719-llvm-381f431e28eb605b3138d2225f1eeea8da6abefe.tar.gz bcm5719-llvm-381f431e28eb605b3138d2225f1eeea8da6abefe.zip | |
Fix a couple -Wuninitialized warnings from gcc. Reported by David Greene.
llvm-svn: 151754
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 92e901a93b8..9c9c7baf8ec 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -500,7 +500,7 @@ double FloatingLiteral::getValueAsApproximateDouble() const { } int StringLiteral::mapCharByteWidth(TargetInfo const &target,StringKind k) { - int CharByteWidth; + int CharByteWidth = 0; switch(k) { case Ascii: case UTF8: @@ -514,6 +514,7 @@ int StringLiteral::mapCharByteWidth(TargetInfo const &target,StringKind k) { break; case UTF32: CharByteWidth = target.getChar32Width(); + break; } assert((CharByteWidth & 7) == 0 && "Assumes character size is byte multiple"); CharByteWidth /= 8; diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 56debcf2087..027ec73d494 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -9000,7 +9000,7 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy, // Decode the result (notice that AST's are still created for extensions). bool CheckInferredResultType = false; bool isInvalid = false; - unsigned DiagKind; + unsigned DiagKind = 0; FixItHint Hint; ConversionFixItGenerator ConvHints; bool MayHaveConvFixit = false; |

