Bug 22535 – ImportC: gcc/clang math intrinsics are rejected.
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-11-22T06:01:17Z
Last change time
2022-02-02T12:03:35Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
dave287091
Comments
Comment #0 by dave287091 — 2021-11-22T06:01:17Z
math.h on macOS uses the following gcc/clang builtins:
`__builtin_fabs`
`__builtin_fabsf`
`__builtin_fabsl
`__builtin_fabsl`
`__builtin_inf`
`__builtin_inff`
`__builtin_infl`
A much larger list of these builtins are described here: https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
It’s common for this header to be directly or transitively included. It is possible at least on macOS to avoid these if you preprocess with the -ffast-math flag as then it will counterintuitively declare extern versions of functions like isfinite instead of defining them as inline functions using these intrinsics.
I don’t know if we want dmd to actually recognize all of these intrinsics.
@WalterBright created dlang/druntime pull request #3702 "fix Issue 22535 - ImportC: gcc/clang math intrinsics are rejected" fixing this issue:
- fix Issue 22535 - ImportC: gcc/clang math intrinsics are rejected
https://github.com/dlang/druntime/pull/3702
Comment #3 by dlang-bot — 2022-02-02T12:03:35Z
dlang/druntime pull request #3702 "fix Issue 22535 - ImportC: gcc/clang math intrinsics are rejected" was merged into master:
- e6a04f222cdf8ee1a6d1cf9fc7dc97118ccfbbbd by Walter Bright:
fix Issue 22535 - ImportC: gcc/clang math intrinsics are rejected
https://github.com/dlang/druntime/pull/3702