Bug 23958 – ImportC: undefined identifier `__builtin__sprintf_chk`

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2023-06-03T16:02:11Z
Last change time
2023-08-04T04:56:09Z
Keywords
pull
Assigned to
No Owner
Creator
Tom

Comments

Comment #0 by mail — 2023-06-03T16:02:11Z
Compiling the following C code on macOS: #include <stdio.h> int main() { char buf[8]; sprintf(buf, "%d", 123); } fails with an error: main.c(5): Error: undefined identifier `__builtin___sprintf_chk` Running the same C code through the preprocessor shows that `sprintf` is replaced with: __builtin___sprintf_chk (buf, 0, __builtin_object_size (buf, 2 > 1 ? 1 : 0), "%d", 123); I'm using macOS 12.6, DMD v2.104.0
Comment #1 by dlang-bot — 2023-08-04T02:02:47Z
@WalterBright created dlang/dmd pull request #15502 "fix Issue 23958 - ImportC: undefined identifier __builtin__sprintf_chk" fixing this issue: - fix Issue 23958 - ImportC: undefined identifier __builtin__sprintf_chk https://github.com/dlang/dmd/pull/15502
Comment #2 by dlang-bot — 2023-08-04T04:56:09Z
dlang/dmd pull request #15502 "fix Issue 23958 - ImportC: undefined identifier __builtin__sprintf_chk" was merged into master: - fa94645086c072858a338eb95990318a873415f6 by Walter Bright: fix Issue 23958 - ImportC: undefined identifier __builtin__sprintf_chk https://github.com/dlang/dmd/pull/15502