Bug 24294 – ImportC: unrecognized command line option -Wno-builtin-macro-redefined with gcc
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2023-12-21T12:06:16Z
Last change time
2023-12-28T04:33:42Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
kdevel
Comments
Comment #0 by kdevel — 2023-12-21T12:06:16Z
With GCC 4.3.2 installed using the ImportC feature (example in issue #24293)
fails:
$ dmd xmysqltest1.d
cc1: error: unrecognized command line option "-Wno-builtin-macro-redefined"
xmysqltest1.d(2): Error: C preprocess command cpp failed for file cmysql.c, exit status 1
GCC 4.6.4 and higher support the requested switch.
Comment #1 by bugzilla — 2023-12-24T06:40:44Z
Not sure what to do about this. compiler/src/dmd/link.d adds this switch, as it is necessary in order for druntime/src/importc.h to do its job.
Comment #2 by kdevel — 2023-12-24T13:48:21Z
(In reply to Walter Bright from comment #1)
> Not sure what to do about this. compiler/src/dmd/link.d adds this switch, as
> it is necessary in order for druntime/src/importc.h to do its job.
GCC: Put a note into the documentation that this switch is used and that a certain GCC version is required. It is in GCC since 2008 [1], but I could not
find the exact GCC version number.
How is the problem solved with other compilers (clang, msvc)?
[1] https://gcc.gnu.org/legacy-ml/gcc-patches/2008-07/msg02321.html
Comment #3 by bugzilla — 2023-12-28T04:09:11Z
Thanks for your help with this!
Comment #4 by dlang-bot — 2023-12-28T04:10:28Z
@WalterBright created dlang/dlang.org pull request #3751 "fix Issue 24294 - ImportC: unrecognized command line option -Wno-buil…" fixing this issue:
- fix Issue 24294 - ImportC: unrecognized command line option -Wno-builtin-macro-redefined with gcc
https://github.com/dlang/dlang.org/pull/3751
Comment #5 by dlang-bot — 2023-12-28T04:33:42Z
dlang/dlang.org pull request #3751 "fix Issue 24294 - ImportC: unrecognized command line option -Wno-buil…" was merged into master:
- eadcaa3aad76bbf3046d7669c53307a304b71f40 by Walter Bright:
fix Issue 24294 - ImportC: unrecognized command line option -Wno-builtin-macro-redefined with gcc
https://github.com/dlang/dlang.org/pull/3751