summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/format/diag-2.c
blob: e7578d3f031e321eec9f046d0bb103ecd64655d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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" } */
}