Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / format / c99-scanf-3.c
blob091a3ea95466510ea643a90f34f07d3cac86eef2
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 } */
6 /* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
8 #include "format.h"
10 void
11 foo (int *ip, char *s, va_list v0, va_list v1, va_list v2, va_list v3,
12 va_list v4, va_list v5)
14 fscanf (stdin, "%d", ip);
15 fscanf (stdin, "%ld", ip); /* { dg-warning "format" "fscanf" } */
16 scanf ("%d", ip);
17 scanf ("%ld", ip); /* { dg-warning "format" "scanf" } */
18 sscanf (s, "%d", ip);
19 sscanf (s, "%ld", ip); /* { dg-warning "format" "sscanf" } */
20 vfscanf (stdin, "%d", v0);
21 vfscanf (stdin, "%Y", v1); /* { dg-warning "format" "vfscanf" } */
22 vscanf ("%d", v2);
23 vscanf ("%Y", v3); /* { dg-warning "format" "vscanf" } */
24 vsscanf (s, "%d", v4);
25 vsscanf (s, "%Y", v5); /* { dg-warning "format" "vsscanf" } */
26 scanf (gettext ("%d"), ip);
27 scanf (gettext ("%ld"), ip);
28 scanf (dgettext ("", "%d"), ip);
29 scanf (dgettext ("", "%ld"), ip);
30 scanf (dcgettext ("", "%d", 0), ip);
31 scanf (dcgettext ("", "%ld", 0), ip);