]> granicus.if.org Git - clang/commitdiff
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)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77630 91177308-0d34-0410-b5e6-96231b3b80d8

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

index ba6781eec4fc349e13a061e8b61d40ee816142d9..d6b6076a14b204c8801125c27a21b565f9dcfffb 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 cd57a63bc2313780b0f0500983fb1485446bbee3..f78ea69894890c9bfe0d0b52b4aa662573243d70 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 64d3fcd57b2a167fb4612acb0037334d41ebed8f..8908adb1057c77c29e5ac0aaeeacdc791f3f4a4e 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
 }