[cfe-commits] r129127 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/Sema/uninit-variables.c test/SemaCXX/uninit-variables-conditional.cpp

Chandler Carruth chandlerc at gmail.com
Thu Apr 7 23:47:15 PDT 2011


Author: chandlerc
Date: Fri Apr  8 01:47:15 2011
New Revision: 129127

URL: http://llvm.org/viewvc/llvm-project?rev=129127&view=rev
Log:
Switch 'is possibly uninitialized' to 'may be uninitialized' based on
Chris's feedback.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/test/Sema/uninit-variables.c
    cfe/trunk/test/SemaCXX/uninit-variables-conditional.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=129127&r1=129126&r2=129127&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri Apr  8 01:47:15 2011
@@ -878,7 +878,7 @@
   "variable %0 is uninitialized when used here">,
   InGroup<Uninitialized>, DefaultIgnore;
 def warn_maybe_uninit_var :
-  Warning<"variable %0 is possibly uninitialized when used here">,
+  Warning<"variable %0 may be uninitialized when used here">,
     InGroup<UninitializedMaybe>, DefaultIgnore;
 def note_uninit_var_def : Note<
   "variable %0 is declared here">;
@@ -886,7 +886,7 @@
   "variable %0 is uninitialized when captured by block">,
   InGroup<Uninitialized>, DefaultIgnore;
 def warn_maybe_uninit_var_captured_by_block : Warning<
-  "variable %0 is possibly uninitialized when captured by block">,
+  "variable %0 may be uninitialized when captured by block">,
   InGroup<UninitializedMaybe>, DefaultIgnore;
 def note_var_fixit_add_initialization : Note<
   "add initialization to silence this warning">;

Modified: cfe/trunk/test/Sema/uninit-variables.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/uninit-variables.c?rev=129127&r1=129126&r2=129127&view=diff
==============================================================================
--- cfe/trunk/test/Sema/uninit-variables.c (original)
+++ cfe/trunk/test/Sema/uninit-variables.c Fri Apr  8 01:47:15 2011
@@ -38,7 +38,7 @@
   int x; // expected-note{{variable 'x' is declared here}} expected-note{{add initialization to silence this warning}}
   if (y)
     x = 1;
-  return x; // expected-warning{{variable 'x' is possibly uninitialized when used here}}
+  return x; // expected-warning{{variable 'x' may be uninitialized when used here}}
 }
 
 int test8(int y) {
@@ -57,7 +57,7 @@
       break;
     x = 1;
   }
-  return x; // expected-warning{{variable 'x' is possibly uninitialized when used here}}
+  return x; // expected-warning{{variable 'x' may be uninitialized when used here}}
 }
 
 int test10(unsigned n) {
@@ -65,7 +65,7 @@
   for (unsigned i = 0 ; i < n; ++i) {
     x = 1;
   }
-  return x; // expected-warning{{variable 'x' is possibly uninitialized when used here}}
+  return x; // expected-warning{{variable 'x' may be uninitialized when used here}}
 }
 
 int test11(unsigned n) {
@@ -73,11 +73,11 @@
   for (unsigned i = 0 ; i <= n; ++i) {
     x = 1;
   }
-  return x; // expected-warning{{variable 'x' is possibly uninitialized when used here}}
+  return x; // expected-warning{{variable 'x' may be uninitialized when used here}}
 }
 
 void test12(unsigned n) {
-  for (unsigned i ; n ; ++i) ; // expected-warning{{variable 'i' is possibly uninitialized when used here}} expected-note{{variable 'i' is declared here}} expected-note{{add initialization to silence this warning}}
+  for (unsigned i ; n ; ++i) ; // expected-warning{{variable 'i' may be uninitialized when used here}} expected-note{{variable 'i' is declared here}} expected-note{{add initialization to silence this warning}}
 }
 
 int test13() {
@@ -134,14 +134,14 @@
 int test20() {
   int z; // expected-note{{variable 'z' is declared here}} expected-note{{add initialization to silence this warning}}
   if ((test19_aux1() + test19_aux2() && test19_aux1()) || test19_aux3(&z))
-    return z; // expected-warning{{variable 'z' is possibly uninitialized when used here}}
+    return z; // expected-warning{{variable 'z' may be uninitialized when used here}}
   return 0;
 }
 
 int test21(int x, int y) {
   int z; // expected-note{{variable 'z' is declared here}} expected-note{{add initialization to silence this warning}}
   if ((x && y) || test19_aux3(&z) || test19_aux2())
-    return z; // expected-warning{{variable 'z' is possibly uninitialized when used here}}
+    return z; // expected-warning{{variable 'z' may be uninitialized when used here}}
   return 0;
 }
 
@@ -169,7 +169,7 @@
     val = 1;
   if (!flag)
     val = 1;
-  return val; // expected-warning{{variable 'val' is possibly uninitialized when used here}}
+  return val; // expected-warning{{variable 'val' may be uninitialized when used here}}
 }
 
 float test25() {
@@ -237,7 +237,7 @@
   void **pc; // expected-note{{variable 'pc' is declared here}} expected-note{{add initialization to silence this warning}}
   void *dummy[] = { &&L1, &&L2 };
  L1:
-    goto *pc; // expected-warning{{variable 'pc' is possibly uninitialized when used here}}
+    goto *pc; // expected-warning{{variable 'pc' may be uninitialized when used here}}
  L2:
     goto *pc;
 }
@@ -277,7 +277,7 @@
 int test41(int x) {
   int y; // expected-note {{variable 'y' is declared here}} expected-note{{add initialization to silence this warning}}
   if (x) y = 1; // no-warning
-  return y; // expected-warning {{variable 'y' is possibly uninitialized when used here}}
+  return y; // expected-warning {{variable 'y' may be uninitialized when used here}}
 }
 
 void test42() {
@@ -289,7 +289,7 @@
 void test43(int i) {
   int x; // expected-note {{variable 'x' is declared here}} expected-note{{add initialization to silence this warning}}
   for (i = 0 ; i < 10; i++)
-    test43_aux(x++); // expected-warning {{variable 'x' is possibly uninitialized when used here}}
+    test43_aux(x++); // expected-warning {{variable 'x' may be uninitialized when used here}}
 }
 
 void test44(int i) {
@@ -297,7 +297,7 @@
   int y; // expected-note {{variable 'y' is declared here}} expected-note{{add initialization to silence this warning}}
   for (i = 0; i < 10; i++ ) {
     test43_aux(x++); // no-warning
-    x += y; // expected-warning {{variable 'y' is possibly uninitialized when used here}}
+    x += y; // expected-warning {{variable 'y' may be uninitialized when used here}}
   }
 }
 

Modified: cfe/trunk/test/SemaCXX/uninit-variables-conditional.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/uninit-variables-conditional.cpp?rev=129127&r1=129126&r2=129127&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/uninit-variables-conditional.cpp (original)
+++ cfe/trunk/test/SemaCXX/uninit-variables-conditional.cpp Fri Apr  8 01:47:15 2011
@@ -19,5 +19,5 @@
   if (bar() || baz() || Foo() || init(&x))
     return 1.0;
 
-  return x; // expected-warning {{variable 'x' is possibly uninitialized when used here}}
+  return x; // expected-warning {{variable 'x' may be uninitialized when used here}}
 }





More information about the cfe-commits mailing list