PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / format / ms-format2.c
blob5c950522a7ca7d47de520605619c56153a97267a
1 /* Test for printf formats. Formats using extensions to the standard
2 should be rejected in strict pedantic mode. But allowed by -Wno-pedantic-ms-format.
3 */
4 /* Origin: Kai Tietz <kai.tietz@onevision.com> */
5 /* { dg-do compile { target { *-*-mingw* } } } */
6 /* { dg-options "-std=iso9899:1999 -pedantic -Wformat -Wno-pedantic-ms-format" } */
8 #define USE_SYSTEM_FORMATS
9 #include "format.h"
11 #ifdef _WIN64
12 #define XXX "%I64x"
13 #else
14 #define XXX "%I32x"
15 #endif
17 void
18 foo (float f, double d, void *p)
20 printf (XXX, p); /* { dg-warning "format" "bad argument types" } */
21 printf ("%I32x", f); /* { dg-warning "format" "bad argument types" } */
22 printf ("%I64x", d); /* { dg-warning "format" "bad argument types" } */