* cfgloopmanip.c (duplicate_loop_to_header_edge): Cleanup profile
[official-gcc.git] / gcc / testsuite / gcc.dg / format / ms_c99-scanf-3.c
blobcde2f3703d42fb14b81f7010f7a52bf829fd0475
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.
3 */
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
9 #include "format.h"
11 void
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" } */
17 scanf ("%d", ip);
18 scanf ("%ld", ip); /* { dg-warning "format" "scanf" } */
19 sscanf (s, "%d", ip);
20 sscanf (s, "%ld", ip); /* { dg-warning "format" "sscanf" } */
21 vfscanf (stdin, "%d", v0);
22 vfscanf (stdin, "%Y", v1); /* { dg-warning "format" "vfscanf" } */
23 vscanf ("%d", v2);
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);