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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [format/] [miss-4.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 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
#include "format.h"
7
 
8
typedef void (*noattr_t) (const char *, ...);
9
typedef noattr_t __attribute__ ((__format__(__printf__, 1, 2))) attr_t;
10
 
11
typedef void (*vnoattr_t) (const char *, va_list);
12
typedef vnoattr_t __attribute__ ((__format__(__printf__, 1, 0))) vattr_t;
13
 
14
void
15
foo1 (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va)
16
{
17
  noattr_t na1, na2;
18
  attr_t a1, a2;
19
 
20
  vnoattr_t vna1, vna2;
21
  vattr_t va1, va2;
22
 
23
  na1 = na;
24
  na2 = a; /* { dg-warning "candidate" "assignment warning" } */
25
  a1 = na;
26
  a2 = a;
27
 
28
  vna1 = vna;
29
  vna2 = va; /* { dg-warning "candidate" "assignment warning" } */
30
  va1 = vna;
31
  va1 = va;
32
}

powered by: WebSVN 2.1.0

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