[cfe-commits] r116300 - /cfe/trunk/lib/Sema/SemaDecl.cpp

Duncan Sands baldrick at free.fr
Tue Oct 12 07:07:59 PDT 2010


Author: baldrick
Date: Tue Oct 12 09:07:59 2010
New Revision: 116300

URL: http://llvm.org/viewvc/llvm-project?rev=116300&view=rev
Log:
Pacify gcc-4.4.

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=116300&r1=116299&r2=116300&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Oct 12 09:07:59 2010
@@ -7217,8 +7217,10 @@
 
   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





More information about the cfe-commits mailing list