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/] [c99-scanf-3.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 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 } */
6
/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
7
 
8
#include "format.h"
9
 
10
void
11
foo (int *ip, char *s, va_list v0, va_list v1, va_list v2, va_list v3,
12
     va_list v4, va_list v5)
13
{
14
  fscanf (stdin, "%d", ip);
15
  fscanf (stdin, "%ld", ip); /* { dg-warning "format" "fscanf" } */
16
  scanf ("%d", ip);
17
  scanf ("%ld", ip); /* { dg-warning "format" "scanf" } */
18
  sscanf (s, "%d", ip);
19
  sscanf (s, "%ld", ip); /* { dg-warning "format" "sscanf" } */
20
  vfscanf (stdin, "%d", v0);
21
  vfscanf (stdin, "%Y", v1); /* { dg-warning "format" "vfscanf" } */
22
  vscanf ("%d", v2);
23
  vscanf ("%Y", v3); /* { dg-warning "format" "vscanf" } */
24
  vsscanf (s, "%d", v4);
25
  vsscanf (s, "%Y", v5); /* { dg-warning "format" "vsscanf" } */
26
  scanf (gettext ("%d"), ip);
27
  scanf (gettext ("%ld"), ip);
28
  scanf (dgettext ("", "%d"), ip);
29
  scanf (dgettext ("", "%ld"), ip);
30
  scanf (dcgettext ("", "%d", 0), ip);
31
  scanf (dcgettext ("", "%ld", 0), ip);
32
}

powered by: WebSVN 2.1.0

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