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/] [c90-scanf-4.c] - Blame information for rev 154

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

Line No. Rev Author Line
1 149 jeremybenn
/* Test for scanf formats.  Test that the C90 functions get their default
2
   attributes in strict C90 mode, but the C99 and gettext functions
3
   do not.
4
*/
5
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
6
/* { dg-do compile } */
7
/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
8
 
9
#include "format.h"
10
 
11
void
12
foo (int *ip, char *s, va_list v0, va_list v1, va_list v2, va_list v3,
13
     va_list v4, va_list v5)
14
{
15
  fscanf (stdin, "%d", ip);
16
  fscanf (stdin, "%ld", ip); /* { dg-warning "format" "fscanf" } */
17
  scanf ("%d", ip);
18
  scanf ("%ld", ip); /* { dg-warning "format" "scanf" } */
19
  sscanf (s, "%d", ip);
20
  sscanf (s, "%ld", ip); /* { dg-warning "format" "sscanf" } */
21
  vfscanf (stdin, "%d", v0);
22
  vfscanf (stdin, "%Y", v1);
23
  vscanf ("%d", v2);
24
  vscanf ("%Y", v3);
25
  vsscanf (s, "%d", v4);
26
  vsscanf (s, "%Y", v5);
27
  scanf (gettext ("%d"), ip);
28
  scanf (gettext ("%ld"), ip);
29
  scanf (dgettext ("", "%d"), ip);
30
  scanf (dgettext ("", "%ld"), ip);
31
  scanf (dcgettext ("", "%d", 0), ip);
32
  scanf (dcgettext ("", "%ld", 0), ip);
33
}

powered by: WebSVN 2.1.0

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