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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [ext/] [strncpy-chk1.C] - Diff between revs 301 and 399

Show entire file | Details | Blame | View Log

Rev 301 Rev 399
Line 1... Line 1...
// PR c++/40502
// PR c++/40502
// { dg-do compile }
// { dg-do compile }
// { dg-options "-O2" }
// { dg-options "-O2" }
 
 
struct A { char x[12], y[35]; };
struct A { char x[12], y[35]; }; // change to y[32] to get warning on or32
struct B { char z[50]; };
struct B { char z[50]; };
 
 
inline void
inline void
foo (char *dest, const char *__restrict src, __SIZE_TYPE__ n)
foo (char *dest, const char *__restrict src, __SIZE_TYPE__ n)
{
{
  __builtin___strncpy_chk (dest, src, n, __builtin_object_size (dest, 0));      // { dg-warning "will always overflow" }
  __builtin___strncpy_chk (dest, src, n, __builtin_object_size (dest, 0));      // { dg-warning "will always overflow" "" { target { ! or32-*-* } } }
}
}
 
 
void bar (const char *, int);
void bar (const char *, int);
 
 
inline void
inline void

powered by: WebSVN 2.1.0

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