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/] [memset-1.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2" } */
3
 
4
typedef __SIZE_TYPE__ size_t;
5
 
6
extern void warn_memset_zero_len (void)
7
__attribute__((__warning__ ("memset used with constant zero length parameter;"
8
                            " this could be due to transposed parameters")));
9
 
10
extern inline __attribute__((gnu_inline, always_inline, artificial)) void *
11
memset (void *dest, int ch, size_t len)
12
{
13
  if (__builtin_constant_p (len) && len == 0)
14
    {
15
      warn_memset_zero_len ();  /* { dg-warning "memset used with constant zero" } */
16
      return dest;
17
    }
18
  return __builtin_memset (dest, ch, len);
19
}
20
 
21
char buf[10];
22
 
23
int
24
main (void)
25
{
26
  memset (buf, sizeof (buf), 0);
27
  return 0;
28
}

powered by: WebSVN 2.1.0

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