]> granicus.if.org Git - clang/commitdiff
Silence an annoying GCC warning about use of an uninitialized variable. Even
authorChandler Carruth <chandlerc@gmail.com>
Wed, 7 Jul 2010 00:36:56 +0000 (00:36 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 7 Jul 2010 00:36:56 +0000 (00:36 +0000)
making the other switch case unreachable, or sinking the 'continue' into it
doesn't silence this.

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

lib/Checker/IdempotentOperationChecker.cpp

index 1118d5e279d4a6226d463b934141dd368cd5fa7c..646c6aff1f6eaa2ee121a1ae1d5d562f7b9d1aab 100644 (file)
@@ -311,7 +311,7 @@ void IdempotentOperationChecker::VisitEndAnalysis(ExplodedGraph &G,
       hash.begin(); i != hash.end(); ++i) {
     if (i->second != Impossible) {
       // Select the error message.
-      const char *msg;
+      const char *msg = 0;
       switch (i->second) {
       case Equal:
         msg = "idempotent operation; both operands are always equal in value";