Compiling the following C code:
#include <string.h>
void foo()
{
memmove(0, 0, 0);
}
Results in the following error:
foo.c(5): Error: undefined identifier `__builtin___memmove_chk`
If I run the C code manually through the preprocessor this is the relevant output:
void foo()
{
__builtin___memmove_chk (0, 0, 0, __builtin_object_size (0, 0));
}
I'm using macOS 13.0.1, DMD v2.101.1 and Xcode 14.2.
Comment #1 by bugzilla — 2023-01-10T05:36:45Z
The Mac headers have this:
#if __has_builtin(__builtin___memmove_chk) || defined(__GNUC__)
#undef memmove
#define memmove(dest, src, len) \
__builtin___memmove_chk (dest, src, len, __darwin_obsz0 (dest))
#endif
meaning https://github.com/dlang/dmd/pull/14799 ought to fix it.
Comment #2 by bugzilla — 2023-01-10T05:48:19Z
Looks like __GNUC__ will have to be #undef'd, too, at least for OSX.