Bug 24862 – cStd cRuntimeLibrary in __traits(getTargetInfo)?

Status
NEW
Severity
enhancement
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-11-16T12:24:34Z
Last change time
2024-12-13T19:38:31Z
Assigned to
No Owner
Creator
Manu
Moved to GitHub: dmd#20546 →

Comments

Comment #0 by turkeyman — 2024-11-16T12:24:34Z
__traits(getTargetInfo) can report "cppRuntimeLibrary" and "cppStd" (the complementary C++ compiler's language version)... Can we also add "cRuntimeLibrary" and "cStd"? Since C has its own language standard revisions and runtime libs... Particularly, this needs support from LDC and GDC too. The runtime library is straightforward; just return the name of the native runtime library (or the name of the specified CRT if an override lib was given on the command line). cStd to report the language standard version is possibly as little more tricky. It doesn't affect the binary in any way I know of like the cppStd does, but the language standard does affect what symbols the program can expect to find in the C runtime library. GDC knows what crt it was built for and the complementary gcc build will also match the reported values by default. LDC similarly, although it doesn't assume a complementary compiler; it should probably report the language expressed by the crt library. DMD has platform specific behaviour. It's a shame that C++ uses the build option `extern-std`, because it doesn't make it easy to select a similar name to control what C language standard we plan to link against...
Comment #1 by robert.schadek — 2024-12-13T19:38:31Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20546 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB