annotate gcc/testsuite/gcc.dg/noncompile/20020213-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR c/5503
kono
parents:
diff changeset
2 Test whether argument checking is done for fputs, bzero and bcmp. */
kono
parents:
diff changeset
3 typedef struct { int i; } FILE;
kono
parents:
diff changeset
4 typedef __SIZE_TYPE__ size_t;
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 int fputs (const char *, FILE *);
kono
parents:
diff changeset
7 /* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 void bzero (void *, size_t);
kono
parents:
diff changeset
10 /* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 int bcmp (const void *, const void *, size_t);
kono
parents:
diff changeset
13 /* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 char buf[32];
kono
parents:
diff changeset
16 FILE *f;
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 int main ()
kono
parents:
diff changeset
19 {
kono
parents:
diff changeset
20 fputs ("foo"); /* { dg-error "too few" } */
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 fputs ("foo", "bar", "baz"); /* { dg-error "too many" } */
kono
parents:
diff changeset
23 /* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } .-1 } */
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 fputs (21, 43);
kono
parents:
diff changeset
26 /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } .-1 } */
kono
parents:
diff changeset
27 /* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } .-2 } */
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 bzero (buf); /* { dg-error "too few" } */
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 bzero (21); /* { dg-error "too few" } */
kono
parents:
diff changeset
32 /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } .-1 } */
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 bcmp (buf, buf + 16); /* { dg-error "too few" } */
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 bcmp (21); /* { dg-error "too few" } */
kono
parents:
diff changeset
37 /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } .-1 } */
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 fputs ("foo", f);
kono
parents:
diff changeset
40 bzero (buf, 32);
kono
parents:
diff changeset
41 bcmp (buf, buf + 16, 16);
kono
parents:
diff changeset
42 return 0;
kono
parents:
diff changeset
43 }