]> granicus.if.org Git - clang/commitdiff
Shorten the static analyzer diagnostic for 'use of garbage value'.
authorTed Kremenek <kremenek@apple.com>
Thu, 24 Sep 2009 00:44:26 +0000 (00:44 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 24 Sep 2009 00:44:26 +0000 (00:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82672 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/GRExprEngineInternalChecks.cpp
test/Analysis/uninit-vals-ps-region.c
test/Analysis/uninit-vals-ps.c

index 2eb5589117f9cfa2306f78ece9f64e0e9127a82e..cc1ec4b77e48f630e54850a769d3b5c1e64a9567 100644 (file)
@@ -235,9 +235,9 @@ public:
                 
         if (Ex) {
           OS << "The " << (isLeft ? "left" : "right")
-             << " operand of the '"
+             << " operand of '"
              << BinaryOperator::getOpcodeStr(B->getOpcode())
-             << "' expression is a garbage value";
+             << "' is a garbage value";
         }          
         else {
           // Neither operand was undefined, but the result is undefined.
index 716b7c920fa2848d54ce0a71e83e5115895bccc1..1561f11c9937bdecda7c8de0e187e2044158058b 100644 (file)
@@ -25,7 +25,7 @@ void test_uninit_pos() {
   struct TestUninit v2 = test_uninit_aux();
   int z;
   v1.y = z;
-  test_unit_aux2(v2.x + v1.y);  // expected-warning{{The right operand of the '+' expression is a garbage value}}
+  test_unit_aux2(v2.x + v1.y);  // expected-warning{{The right operand of '+' is a garbage value}}
 }
 void test_uninit_neg() {
   struct TestUninit v1 = { 0, 0 };
index 32b4324a7da0c7e84658226601c2ca383301d2a5..759c7edbcc57eb5c983fc436420c5ca85d96ddd7 100644 (file)
@@ -22,7 +22,7 @@ int f2() {
   
   int x;
   
-  if (x+1)  // expected-warning{{The left operand of the '+' expression is a garbage value}}
+  if (x+1)  // expected-warning{{The left operand of '+' is a garbage value}}
     return 1;
     
   return 2;  
@@ -31,13 +31,13 @@ int f2() {
 int f2_b() {
   int x;
   
-  return ((1+x)+2+((x))) + 1 ? 1 : 2; // expected-warning{{The right operand of the '+' expression is a garbage value}}
+  return ((1+x)+2+((x))) + 1 ? 1 : 2; // expected-warning{{The right operand of '+' is a garbage value}}
 }
 
 int f3(void) {
   int i;
   int *p = &i;
-  if (*p > 0) // expected-warning{{The left operand of the '>' expression is a garbage value}}
+  if (*p > 0) // expected-warning{{The left operand of '>' is a garbage value}}
     return 0;
   else
     return 1;