1 /* { dg-do compile } */
2 /* { dg-options "-Wall -Wshadow" } */
4 extern double strtod (const char *, char **);
5 #define UNUSED __attribute__ ((unused))
7 /* A built-in function may be overridden by an old-style definition
8 specifying too few arguments... */
9 double cos () /* { dg-warning "shadows a built-in" } */
11 /* { dg-warning "number of arguments doesn't match built-in prototype" "built-in" { target *-*-* } 10 } */
12 return strtod ("nan", 0);
15 /* the right number, but the wrong type, arguments... */
16 double sin (foo
) /* { dg-warning "shadows a built-in" } */
18 { /* { dg-warning "argument 'foo' doesn't match built-in prototype" } */
19 return strtod ("nan", 0);
22 /* or too many arguments. */
23 long double cosl (foo
, bar
) /* { dg-warning "shadows a built-in" } */
24 const char *foo UNUSED
;
26 { /* { dg-warning "number of arguments doesn't match built-in prototype" } */
27 /* { dg-warning "argument 'foo' doesn't match built-in prototype" "foo" { target *-*-* } 26 } */
28 return strtod ("nan", 0);