1 /* Test for scanf formats. Test that the C99 functions get their default
2 attributes in strict C99 mode, but the gettext functions do not.
4 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
5 /* { dg-do compile { target { *-*-mingw* } } } */
6 /* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
8 #define USE_SYSTEM_FORMATS
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
); /* { dg-warning "format" "vfscanf" } */
24 vscanf ("%Y", v3
); /* { dg-warning "format" "vscanf" } */
25 vsscanf (s
, "%d", v4
);
26 vsscanf (s
, "%Y", v5
); /* { dg-warning "format" "vsscanf" } */
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
);