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/] [attr-6.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test for format attributes: test default attributes are applied
2
   to implicit declarations.  */
3
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
4
/* { dg-do compile } */
5
/* { dg-options "-std=gnu89 -Wformat" } */
6
 
7
/* We can't #include "format.h" here.  */
8
 
9
/* Technically, none of the format functions should be implicitly declared;
10
   either the implicit type is wrong, the function has variable arguments
11
   or it requires a type declared in a header.  However, some bad programming
12
   practice uses implicit declarations of some of these functions.
13
 
14
   Note that printf is not used in this test because of the declaration
15
   of it as a built-in function.  */
16
 
17
void
18
foo (const char *s, int *p)
19
{
20
  scanf("%ld", p); /* { dg-warning "format" "implicit scanf" } */
21
  /* { dg-warning "implicit" "implicit decl warning" { target *-*-* } 20 } */
22
}

powered by: WebSVN 2.1.0

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