[Issue 23011] importC: asm label to set symbol name doesn't work with externs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 15 09:52:20 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23011

--- Comment #3 from duser at neet.fi ---
there is limited support for asm() in importC to use it like pragma(mangle),
added for issue 21934

this wasn't documented on the importC spec page so i only found out about it
when reading the C parser source

https://github.com/dlang/dmd/blob/0e3e0f9/src/dmd/cparse.d#L1845

glibc headers use asm() this way to redirect some functions based on feature
macros (like whether off_t should be 64 bits on 32-bit, or whether non-standard
GNU versions of some functions should be used) - if the asm() is ignored, it
might silently link against the wrong function

--


More information about the Digitalmars-d-bugs mailing list