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-1.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 for warnings for missing format attributes.  */
2
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
3
/* { dg-do compile } */
4
/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
5
 
6
#include "format.h"
7
 
8
void
9
foo (const char *fmt, ...)
10
{
11
  va_list ap;
12
  va_start (ap, fmt);
13
  vprintf (fmt, ap); /* { dg-warning "candidate" "printf attribute warning" } */
14
  va_end (ap);
15
}
16
 
17
void
18
bar (const char *fmt, ...)
19
{
20
  va_list ap;
21
  va_start (ap, fmt);
22
  vscanf (fmt, ap); /* { dg-warning "candidate" "scanf attribute warning" } */
23
  va_end (ap);
24
}
25
 
26
__attribute__((__format__(gnu_attr___printf__, 1, 2))) void
27
foo2 (const char *fmt, ...)
28
{
29
  va_list ap;
30
  va_start (ap, fmt);
31
  vprintf (fmt, ap);
32
  va_end (ap);
33
}
34
 
35
void
36
vfoo (const char *fmt, va_list arg)
37
{
38
  vprintf (fmt, arg); /* { dg-warning "candidate" "printf attribute warning 2" } */
39
}

powered by: WebSVN 2.1.0

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