5 ms·
> D understands how C++ function names are "mangled" and the correct C++ function call/return sequence. How does it work in practice ? C++ name mangling is not
by seren 9y ago
> D understands how C++ function names are "mangled" and the correct C++ function call/return sequence.
How does it work in practice ? C++ name mangling is not standardized and so every compiler can implement its own scheme. So does it mean there is a list of D compatible c++ compiler somewhere ? I have the feeling that if you are using some exotic proprietary c++ compiler it won't work well.
- kryptiskt 9y agoIn practice there are two dominating standards nowadays, the Itanium ABI and Microsoft's, so it's quite tractable to handle the common cases.
- seren 9y agoThanks, I might be biased because I have a legacy platform still using gcc 2.7, which is older than the adoption of the Itanium ABI.
- kbenson 9y agoThere was some interesting discussion regarding this here recently in the comments regarding a Rust demangling library[1]. 1: https://news.ycombinator.com/item?id=13706799 https://news.ycombinator.com/item?id=13706799
- WalterBright 9y ago> C++ name mangling is not standardized and so every compiler can implement its own scheme. That's right, and the D compiler deals with that by customizing the C++ mangling for every platform.
- seren 9y agoI am just curious what the actual list is, it is surely not possible to support every version of every compiler on every platform.
- WalterBright 9y agoWe don't. We pick one.