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 | fd819783aafa39b3bfdfcc095270352074ef4734 (patch) | |
tree | d33f856254f176bd97458ecc361b937025f37ccd /lib/AST/Expr.cpp | |
parent | 8d6ff02cb78c67c615125782967b44d1b37e5815 (diff) |
Fix a couple -Wuninitialized warnings from gcc. Reported by David Greene.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151754 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 92e901a93b..9c9c7baf8e 100644 --- a/lib/AST/Expr.cpp +++ b/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; |