From f5145921975c4b6a3d986ed34ab716d4dadeb8f9 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Sat, 11 Jul 2009 00:21:48 +0000 Subject: [PATCH] Fix warning when compiling with optimizations: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. llvm-svn: 75321 --- clang/lib/Sema/SemaExpr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 8611fd546149..058bda4d10a8 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -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();