gcc/testsuite/gcc.dg/format/diag-2.c
raw| 1 | /* Test for format diagnostics. Proper type names (bug 1027). */ |
| 2 | /* Origin: Joseph Myers <[email protected]> */ |
| 3 | /* { dg-do compile } */ |
| 4 | /* { dg-options "-std=gnu99 -Wformat" } */ |
| 5 | |
| 6 | #include "format.h" |
| 7 | |
| 8 | void |
| 9 | foo (double d) |
| 10 | { |
| 11 | printf ("%s", &d); /* { dg-warning "char \\*" "correct arg type" } */ |
| 12 | scanf ("%zu", &d); /* { dg-warning "size_t \\*" "correct arg type" } */ |
| 13 | } |