1 /* Test for warnings for missing format attributes. */
2 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
3 /* { dg-do compile } */
4 /* { dg-options "-Wmissing-format-attribute" } */
5 /* { dg-options "-Wmissing-format-attribute -Wno-abi" { target arm_eabi } } */
6 /* VxWorks does not provide vscanf, either in kernel or RTP mode. */
7 /* { dg-error "not declared" "" { target *-*-vxworks* } 26 } */
13 foo (const char *fmt, ...)
17 vprintf (fmt, ap); /* { dg-warning "candidate" "printf attribute warning" } */
22 bar (const char *fmt, ...)
26 vscanf (fmt, ap); /* { dg-warning "candidate" "scanf attribute warning" { xfail *-*-vxworks* } } */
30 __attribute__((__format__(__printf__, 1, 2))) void
31 foo2 (const char *fmt, ...)
40 vfoo (const char *fmt, va_list arg)
42 vprintf (fmt, arg); /* { dg-warning "candidate" "printf attribute warning 2" } */