Add casts to avoid a bunch of unused expr warnings. (They aren't reported right now...
authorAnders Carlsson <andersca@mac.com>
Thu, 30 Jul 2009 22:37:41 +0000 (22:37 +0000)
committerAnders Carlsson <andersca@mac.com>
Thu, 30 Jul 2009 22:37:41 +0000 (22:37 +0000)
llvm-svn: 77630

clang/test/Analysis/array-struct.c
clang/test/Analysis/casts.c
clang/test/Analysis/region-only-test.c

index ba6781e..d6b6076 100644 (file)
@@ -143,7 +143,7 @@ void f15() {
   int a[10];
   bar(a);
   if (a[1]) // no-warning
-    1;
+    (void)1;
 }
 
 struct s3 p[1];
index cd57a63..f78ea69 100644 (file)
@@ -28,7 +28,7 @@ void f1(struct s **pval) {
   tbool = (int *)pval; // Should record the cast-to type here.
   char c = (unsigned char) *tbool; // Should use cast-to type to create symbol.
   if (*tbool == -1)
-    3;
+    (void)3;
 }
 
 void f2(const char *str) {
index 64d3fcd..8908adb 100644 (file)
@@ -9,5 +9,5 @@ void foo(int* p) {
   if (p[0] == 1)
     x = &a;
   if (p[0] == 1)
-    *x; // no-warning
+    (void)*x; // no-warning
 }