OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [format/] [z-1.c] - Rev 298

Compare with Previous | Blame | View Log

/* Test for bugs with %z and %Z formats.  See PRs c/89, c/156, c/376.  */
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
/* { dg-do compile } */
/* { dg-options "-Wformat" } */
 
#include "format.h"
 
size_t
foo (void)
{
  size_t t;
  scanf ("%zu", &t); /* { dg-bogus "length|format" "bogus scanf warning" } */
  return t;
}
 
void
bar (size_t t)
{
  printf ("%zu\n", t); /* { dg-bogus "format" "bogus printf warning" } */
}
 
/* The %Z printf format is an old GNU libc extension to do the same thing.  */
 
void
baz (size_t t)
{
  printf ("%Zu\n", t); /* { dg-bogus "format" "bogus printf warning" } */
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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