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/] [c90-scanf-4.c] - Diff between revs 298 and 384

Only display areas with differences | Details | Blame | View Log

Rev 298 Rev 384
/* Test for scanf formats.  Test that the C90 functions get their default
/* Test for scanf formats.  Test that the C90 functions get their default
   attributes in strict C90 mode, but the C99 and gettext functions
   attributes in strict C90 mode, but the C99 and gettext functions
   do not.
   do not.
*/
*/
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
/* { dg-do compile { target { ! *-*-mingw* } } } */
/* { dg-do compile { target { ! *-*-mingw* } } } */
/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
 
 
#include "format.h"
#include "format.h"
 
 
void
void
foo (int *ip, char *s, va_list v0, va_list v1, va_list v2, va_list v3,
foo (int *ip, char *s, va_list v0, va_list v1, va_list v2, va_list v3,
     va_list v4, va_list v5)
     va_list v4, va_list v5)
{
{
  fscanf (stdin, "%d", ip);
  fscanf (stdin, "%d", ip);
  fscanf (stdin, "%ld", ip); /* { dg-warning "format" "fscanf" } */
  fscanf (stdin, "%ld", ip); /* { dg-warning "format" "fscanf" } */
  scanf ("%d", ip);
  scanf ("%d", ip);
  scanf ("%ld", ip); /* { dg-warning "format" "scanf" } */
  scanf ("%ld", ip); /* { dg-warning "format" "scanf" } */
  sscanf (s, "%d", ip);
  sscanf (s, "%d", ip);
  sscanf (s, "%ld", ip); /* { dg-warning "format" "sscanf" } */
  sscanf (s, "%ld", ip); /* { dg-warning "format" "sscanf" } */
  vfscanf (stdin, "%d", v0);
  vfscanf (stdin, "%d", v0);
  vfscanf (stdin, "%Y", v1);
  vfscanf (stdin, "%Y", v1);
  vscanf ("%d", v2);
  vscanf ("%d", v2);
  vscanf ("%Y", v3);
  vscanf ("%Y", v3);
  vsscanf (s, "%d", v4);
  vsscanf (s, "%d", v4);
  vsscanf (s, "%Y", v5);
  vsscanf (s, "%Y", v5);
  scanf (gettext ("%d"), ip);
  scanf (gettext ("%d"), ip);
  scanf (gettext ("%ld"), ip);
  scanf (gettext ("%ld"), ip);
  scanf (dgettext ("", "%d"), ip);
  scanf (dgettext ("", "%d"), ip);
  scanf (dgettext ("", "%ld"), ip);
  scanf (dgettext ("", "%ld"), ip);
  scanf (dcgettext ("", "%d", 0), ip);
  scanf (dcgettext ("", "%d", 0), ip);
  scanf (dcgettext ("", "%ld", 0), ip);
  scanf (dcgettext ("", "%ld", 0), ip);
}
}
 
 

powered by: WebSVN 2.1.0

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