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/] [cast-1.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 strings cast through integer types: should not be treated
2
   as format strings unless the types are of the same width as
3
   pointers (intptr_t or similar).  */
4
/* Origin: Joseph Myers <joseph@codesourcery.com> */
5
/* { dg-do compile } */
6
/* { dg-options "-Wformat" } */
7
 
8
#include "format.h"
9
 
10
void
11
f (int x)
12
{
13
  printf("%s", x); /* { dg-warning "format" } */
14
  printf((char *)(size_t)"%s", x); /* { dg-warning "format" } */
15
  printf((char *)(char)"%s", x); /* { dg-warning "warning: cast from pointer to integer of different size" } */
16
}

powered by: WebSVN 2.1.0

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