Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / gcc4 / gcc / testsuite / gcc.dg / format / miss-1.c
blob839f2963ae7cfb51e8fc28bfa5aeddb471fb6c65
1 /* Test for warnings for missing format attributes. */
2 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
3 /* { dg-do compile } */
4 /* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
6 #include "format.h"
8 void
9 foo (const char *fmt, ...)
11 va_list ap;
12 va_start (ap, fmt);
13 vprintf (fmt, ap); /* { dg-warning "candidate" "printf attribute warning" } */
14 va_end (ap);
17 void
18 bar (const char *fmt, ...)
20 va_list ap;
21 va_start (ap, fmt);
22 vscanf (fmt, ap); /* { dg-warning "candidate" "scanf attribute warning" } */
23 va_end (ap);
26 __attribute__((__format__(__printf__, 1, 2))) void
27 foo2 (const char *fmt, ...)
29 va_list ap;
30 va_start (ap, fmt);
31 vprintf (fmt, ap);
32 va_end (ap);
35 void
36 vfoo (const char *fmt, va_list arg)
38 vprintf (fmt, arg); /* { dg-warning "candidate" "printf attribute warning 2" } */