]> granicus.if.org Git - clang/commitdiff
Pacify gcc-4.4.
authorDuncan Sands <baldrick@free.fr>
Tue, 12 Oct 2010 14:07:59 +0000 (14:07 +0000)
committerDuncan Sands <baldrick@free.fr>
Tue, 12 Oct 2010 14:07:59 +0000 (14:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116300 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index 424e6d19a46c8cae949fb2ca6e24f6e2044f6664..7f844056a3a6cba0cbf2c6d6d71133fa2cdb1fc1 100644 (file)
@@ -7217,8 +7217,10 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
 
   if (Enum->isFixed()) {
     BestType = BestPromotionType = Enum->getIntegerType();
-    // We don't set BestWidth, because BestType is going to be the
-    // type of the enumerators.
+    // We don't need to set BestWidth, because BestType is going to be the type
+    // of the enumerators, but we do anyway because otherwise some compilers
+    // warn that it might be used uninitialized.
+    BestWidth = CharWidth;
   }
   else if (NumNegativeBits) {
     // If there is a negative value, figure out the smallest integer type (of