OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [format/] [miss-3.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 689 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
void
16
foo1 (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va)
17
{
18
  noattr_t na1 = na;
19
  noattr_t na2 = a; /* { dg-warning "candidate" "initialization warning" } */
20
  attr_t a1 = na;
21
  attr_t a2 = a;
22
 
23
  vnoattr_t vna1 = vna;
24
  vnoattr_t vna2 = va; /* { dg-warning "candidate" "initialization warning" } */
25
  vattr_t va1 = vna;
26
  vattr_t va2 = va;
27
}

powered by: WebSVN 2.1.0

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