Bug 23583 – ImportC: undefined identifier __builtin___memmove_chk

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2022-12-27T20:03:45Z
Last change time
2023-01-14T10:13:32Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
Jacob Carlborg
See also
https://issues.dlang.org/show_bug.cgi?id=23580, https://issues.dlang.org/show_bug.cgi?id=23581, https://issues.dlang.org/show_bug.cgi?id=23582

Comments

Comment #0 by doob — 2022-12-27T20:03:45Z
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.
Comment #3 by dlang-bot — 2023-01-11T03:12:23Z
@WalterBright created dlang/dmd pull request #14801 "fix Issue 23583 - ImportC: undefined identifier __builtin___memmove_chk" fixing this issue: - fix Issue 23583 - ImportC: undefined identifier __builtin___memmove_chk https://github.com/dlang/dmd/pull/14801
Comment #4 by dlang-bot — 2023-01-14T10:13:32Z
dlang/dmd pull request #14801 "fix Issue 23583 - ImportC: undefined identifier __builtin___memmove_chk" was merged into master: - 23e2b3c94378848f80b4936c3f471c4ba844f9cc by Walter Bright: fix Issue 23583 - ImportC: undefined identifier __builtin___memmove_chk https://github.com/dlang/dmd/pull/14801