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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [format/] [ms_miss-4.c] - Blame information for rev 298

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 { target { *-*-mingw* } } } */
4
/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
5
 
6
#define USE_SYSTEM_FORMATS
7
#include "format.h"
8
 
9
typedef void (*noattr_t) (const char *, ...);
10
typedef noattr_t __attribute__ ((__format__(__ms_printf__, 1, 2))) attr_t;
11
 
12
typedef void (*vnoattr_t) (const char *, va_list);
13
typedef vnoattr_t __attribute__ ((__format__(__ms_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, na2;
19
  attr_t a1, a2;
20
 
21
  vnoattr_t vna1, vna2;
22
  vattr_t va1, va2;
23
 
24
  na1 = na;
25
  na2 = a; /* { dg-warning "candidate" "assignment warning" } */
26
  a1 = na;
27
  a2 = a;
28
 
29
  vna1 = vna;
30
  vna2 = va; /* { dg-warning "candidate" "assignment warning" } */
31
  va1 = vna;
32
  va1 = va;
33
}

powered by: WebSVN 2.1.0

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