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" } */
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
;
15 foo1 (noattr_t na
, attr_t a
, int i
)
20 return a
; /* { dg-warning "candidate" "return type warning" } */
24 foo2 (noattr_t na
, attr_t a
, int i
)
33 foo3 (vnoattr_t vna
, vattr_t va
, int i
)
38 return va
; /* { dg-warning "candidate" "return type warning" } */
42 foo4 (vnoattr_t vna
, vattr_t va
, int i
)