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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [format/] [ms_c99-scanf-3.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* Test for scanf formats.  Test that the C99 functions get their default
2
   attributes in strict C99 mode, but the gettext functions do not.
3
*/
4
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
5
/* { dg-do compile { target { *-*-mingw* } } } */
6
/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
7
 
8
#define USE_SYSTEM_FORMATS
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); /* { dg-warning "format" "vfscanf" } */
23
  vscanf ("%d", v2);
24
  vscanf ("%Y", v3); /* { dg-warning "format" "vscanf" } */
25
  vsscanf (s, "%d", v4);
26
  vsscanf (s, "%Y", v5); /* { dg-warning "format" "vsscanf" } */
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.