diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/format/diag-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/format/diag-2.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/format/diag-2.c b/gcc/testsuite/gcc.dg/format/diag-2.c new file mode 100644 index 000000000..e7578d3f0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/diag-2.c @@ -0,0 +1,13 @@ +/* Test for format diagnostics. Proper type names (bug 1027). */ +/* Origin: Joseph Myers <jsm@polyomino.org.uk> */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99 -Wformat" } */ + +#include "format.h" + +void +foo (double d) +{ + printf ("%s", &d); /* { dg-warning "char \\*" "correct arg type" } */ + scanf ("%zu", &d); /* { dg-warning "size_t \\*" "correct arg type" } */ +} |