Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.dg / format / ms_c90-scanf-2.c
blobb55122792abf912137c91d1cc52007c29de4f7b3
1 /* Test for scanf formats. Formats using C99 features should be rejected
2 outside of C99 mode.
3 */
4 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
5 /* { dg-do compile { target { *-*-mingw* } } } */
6 /* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
8 #define USE_SYSTEM_FORMATS
9 #include "format.h"
11 void
12 foo (signed char *hhp, float *fp, llong *llp, intmax_t *jp,
13 size_t *zp, ptrdiff_t *tp)
15 /* Some tests already in c90-scanf-1.c. */
16 /* The widths hh, ll, j, z, t are new. */
17 scanf ("%hhd", hhp); /* { dg-warning "unknown|format" "%hh is unsupported" } */
18 scanf ("%I64d", llp); /* { dg-warning "length|C" "%I64 in C90" } */
19 scanf ("%jd", jp); /* { dg-warning "unknown|format" "%j is unsupported" } */
20 scanf ("%zu", zp); /* { dg-warning "unknown|format" "%z is unsupported" } */
21 scanf ("%td", tp); /* { dg-warning "unknown|format" "%t is unsupported" } */
22 /* The formats F, a, A are new. */
23 scanf ("%F", fp); /* { dg-warning "unknown|format" "%F is unsupported" } */
24 scanf ("%a", fp); /* { dg-warning "unknown|format" "%a is unsupported" } */
25 scanf ("%A", fp); /* { dg-warning "unknown|format" "%A is unsupported" } */