No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gcc4 / gcc / testsuite / gcc.dg / format / miss-3.c
blobc588bed3519424ddc9da15d8c30c2f77d9d4f31c
1 /* Test warnings for missing format attributes on function pointers. */
2 /* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
3 /* { dg-do compile } */
4 /* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
6 #include "format.h"
8 typedef void (*noattr_t) (const char *, ...);
9 typedef noattr_t __attribute__ ((__format__(__printf__, 1, 2))) attr_t;
11 typedef void (*vnoattr_t) (const char *, va_list);
12 typedef vnoattr_t __attribute__ ((__format__(__printf__, 1, 0))) vattr_t;
14 void
15 foo1 (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va)
17 noattr_t na1 = na;
18 noattr_t na2 = a; /* { dg-warning "candidate" "initialization warning" } */
19 attr_t a1 = na;
20 attr_t a2 = a;
22 vnoattr_t vna1 = vna;
23 vnoattr_t vna2 = va; /* { dg-warning "candidate" "initialization warning" } */
24 vattr_t va1 = vna;
25 vattr_t va2 = va;