]> granicus.if.org Git - clang/commitdiff
Fix warning when compiling with optimizations:
authorTed Kremenek <kremenek@apple.com>
Sat, 11 Jul 2009 00:21:48 +0000 (00:21 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 11 Jul 2009 00:21:48 +0000 (00:21 +0000)
  warning: ‘OPT’ may be used uninitialized in this function

Now OPT is initialized to NULL. I'm not certain if this is the correct fix;
others please review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75321 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index 8611fd546149f0354afbe62ab6a81f2dd61263a2..058bda4d10a8c5d9aebae67e188b43be0bfc1a6d 100644 (file)
@@ -3832,8 +3832,8 @@ inline QualType Sema::CheckAdditionOperands( // C99 6.5.6
     
     if (IExp->getType()->isIntegerType()) {
       QualType PointeeTy;
-      const PointerType *PTy;
-      const ObjCObjectPointerType *OPT;
+      const PointerType *PTy = NULL;
+      const ObjCObjectPointerType *OPT = NULL;
       
       if ((PTy = PExp->getType()->getAsPointerType()))
         PointeeTy = PTy->getPointeeType();