From: Anders Carlsson Date: Thu, 30 Jul 2009 22:37:41 +0000 (+0000) Subject: Add casts to avoid a bunch of unused expr warnings. (They aren't reported right now... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9668b1f6c87bd8d9af87e29900508a52584404ef;p=clang Add casts to avoid a bunch of unused expr warnings. (They aren't reported right now due to a bug that I intend to fix). Ted, please review. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77630 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/array-struct.c b/test/Analysis/array-struct.c index ba6781eec4..d6b6076a14 100644 --- a/test/Analysis/array-struct.c +++ b/test/Analysis/array-struct.c @@ -143,7 +143,7 @@ void f15() { int a[10]; bar(a); if (a[1]) // no-warning - 1; + (void)1; } struct s3 p[1]; diff --git a/test/Analysis/casts.c b/test/Analysis/casts.c index cd57a63bc2..f78ea69894 100644 --- a/test/Analysis/casts.c +++ b/test/Analysis/casts.c @@ -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) { diff --git a/test/Analysis/region-only-test.c b/test/Analysis/region-only-test.c index 64d3fcd57b..8908adb105 100644 --- a/test/Analysis/region-only-test.c +++ b/test/Analysis/region-only-test.c @@ -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 }