111
|
1 /* PR c/5503
|
|
2 Test whether argument checking is done for fputs, bzero and bcmp. */
|
|
3 typedef struct { int i; } FILE;
|
|
4 typedef __SIZE_TYPE__ size_t;
|
|
5
|
|
6 int fputs (const char *, FILE *);
|
|
7 /* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */
|
|
8
|
|
9 void bzero (void *, size_t);
|
|
10 /* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */
|
|
11
|
|
12 int bcmp (const void *, const void *, size_t);
|
|
13 /* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */
|
|
14
|
|
15 char buf[32];
|
|
16 FILE *f;
|
|
17
|
|
18 int main ()
|
|
19 {
|
|
20 fputs ("foo"); /* { dg-error "too few" } */
|
|
21
|
|
22 fputs ("foo", "bar", "baz"); /* { dg-error "too many" } */
|
|
23 /* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } .-1 } */
|
|
24
|
|
25 fputs (21, 43);
|
|
26 /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } .-1 } */
|
|
27 /* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } .-2 } */
|
|
28
|
|
29 bzero (buf); /* { dg-error "too few" } */
|
|
30
|
|
31 bzero (21); /* { dg-error "too few" } */
|
|
32 /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } .-1 } */
|
|
33
|
|
34 bcmp (buf, buf + 16); /* { dg-error "too few" } */
|
|
35
|
|
36 bcmp (21); /* { dg-error "too few" } */
|
|
37 /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } .-1 } */
|
|
38
|
|
39 fputs ("foo", f);
|
|
40 bzero (buf, 32);
|
|
41 bcmp (buf, buf + 16, 16);
|
|
42 return 0;
|
|
43 }
|