aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pragma-diag-10.c
blob: a1637bea26b3f0be45e206d1a40d1478c2ac629b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* PR middle-end/98512 - #pragma GCC diagnostic ignored ineffective
   in conjunction with alias attribute
   { dg-do compile }
   { dg-options "-O2 -Wall" }
   { dg-require-alias "" } */

void *
__rawmemchr_ppc (const void *s, int c)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#pragma GCC diagnostic ignored "-Wstringop-overread"
  if (c != 0)
    return __builtin_memchr (s, c, (unsigned long)-1);    // { dg-bogus "specified bound \\d+ exceeds maximum object size" }
#pragma GCC diagnostic pop

  return (char *)s + __builtin_strlen (s);
}

extern __typeof (__rawmemchr_ppc) __EI___rawmemchr_ppc
  __attribute__((alias ("__rawmemchr_ppc")));