| 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 <[email protected]> */ |
| 5 |
/* { dg-do compile { target { *-*-mingw* } } } */ |
| 6 |
/* { dg-options "-std=iso9899:1999 -pedantic -Wformat -Wno-pedantic-ms-format" } */ |
| 7 |
|
| 8 |
#define USE_SYSTEM_FORMATS |
| 9 |
#include "format.h" |
| 10 |
|
| 11 |
#ifdef _WIN64 |
| 12 |
#define XXX "%I64x" |
| 13 |
#else |
| 14 |
#define XXX "%I32x" |
| 15 |
#endif |
| 16 |
|
| 17 |
void |
| 18 |
foo (float f, double d, void *p) |
| 19 |
{ |
| 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" } */ |
| 23 |
} |