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-error "not declared" "" { target *-*-solaris2.5.1 *-*-solaris2.[5-8] } 24 } */
11 foo (const char *fmt, ...)
15 vprintf (fmt, ap); /* { dg-warning "candidate" "printf attribute warning" } */
20 bar (const char *fmt, ...)
24 vscanf (fmt, ap); /* { dg-warning "candidate" "scanf attribute warning" { xfail *-*-solaris2.5.1 *-*-solaris2.[5-8] } } */
28 __attribute__((__format__(__printf__, 1, 2))) void
29 foo2 (const char *fmt, ...)
38 vfoo (const char *fmt, va_list arg)
40 vprintf (fmt, arg); /* { dg-warning "candidate" "printf attribute warning 2" } */