https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112563

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Maybe
extern "C" {
  static void *memcpy (void *, const void *, decltype (sizeof 0)) __attribute__
((weakref ("__sanitizer_internal_memcpy")));
  static void *memmove (void *, const void *, decltype (sizeof 0))
__attribute__ ((weakref ("__sanitizer_internal_memmove")));
  static void *memset (void *, int, decltype (sizeof 0)) __attribute__
((weakref ("__sanitizer_internal_memset")));
}

struct S { char s[512]; };

void
foo (S *p, S *q)
{
  *p = *q;
}

void
bar (int, void *r, void *s)
{
  memcpy (r, s, 512);
}

void
baz (int, int, void *t, void *u)
{
  __builtin_memcpy (t, u, 512);
}
works instead.
But in any case, I'd use it only when what is in doesn't really work.

Reply via email to