OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.dg/] [format/] [miss-6.c] - Blame information for rev 437

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* 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" } */
5
 
6
#define DONT_GNU_PROTOTYPE
7
#include "format.h"
8
 
9
typedef void (*noattr_t) (const char *, ...);
10
typedef noattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 2))) attr_t;
11
 
12
typedef void (*vnoattr_t) (const char *, va_list);
13
typedef vnoattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 0))) vattr_t;
14
 
15
extern void foo1 (noattr_t);
16
extern void foo2 (attr_t);
17
extern void foo3 (vnoattr_t);
18
extern void foo4 (vattr_t);
19
 
20
void
21
foo (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va)
22
{
23
  foo1 (na);
24
  foo1 (a); /* { dg-warning "candidate" "parameter passing warning" } */
25
  foo2 (na);
26
  foo2 (a);
27
 
28
  foo3 (vna);
29
  foo3 (va); /* { dg-warning "candidate" "parameter passing warning" } */
30
  foo4 (vna);
31
  foo4 (va);
32
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.