111
|
1 /* Test whether statement with no effect warnings are not given for last
|
|
2 statements inside of statement expression. */
|
|
3 /* { dg-do compile } */
|
|
4 /* { dg-options "-O -Wall" } */
|
|
5
|
|
6 void bar (char *p, char *q);
|
|
7
|
|
8 int main()
|
|
9 {
|
|
10 char foo [32], *p;
|
|
11
|
|
12 ({
|
|
13 void *s = (foo);
|
|
14 __builtin_memset (s, '\0', sizeof (foo));
|
|
15 s; /* { dg-warning "no effect" "statement with no effect warning" } */
|
|
16 s; /* { dg-bogus "no effect" "bogus statement with no effect warning" } */
|
|
17 });
|
|
18 p = foo;
|
|
19 p; /* { dg-warning "no effect" "statement with no effect warning" } */
|
|
20 bar (foo, p);
|
|
21 return 0;
|
|
22 }
|