1 /* Test for scanf formats. Test that the C90 functions get their default
2 attributes in strict C90 mode, but the C99 and gettext functions
5 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
6 /* { dg-do compile } */
7 /* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
12 foo (int *ip
, char *s
, va_list v0
, va_list v1
, va_list v2
, va_list v3
,
13 va_list v4
, va_list v5
)
15 fscanf (stdin
, "%d", ip
);
16 fscanf (stdin
, "%ld", ip
); /* { dg-warning "format" "fscanf" } */
18 scanf ("%ld", ip
); /* { dg-warning "format" "scanf" } */
20 sscanf (s
, "%ld", ip
); /* { dg-warning "format" "sscanf" } */
21 vfscanf (stdin
, "%d", v0
);
22 vfscanf (stdin
, "%Y", v1
);
25 vsscanf (s
, "%d", v4
);
26 vsscanf (s
, "%Y", v5
);
27 scanf (gettext ("%d"), ip
);
28 scanf (gettext ("%ld"), ip
);
29 scanf (dgettext ("", "%d"), ip
);
30 scanf (dgettext ("", "%ld"), ip
);
31 scanf (dcgettext ("", "%d", 0), ip
);
32 scanf (dcgettext ("", "%ld", 0), ip
);