extern (c)

Imperatorn johan_forsberg_86 at hotmail.com
Wed Oct 11 17:16:37 UTC 2023


On Wednesday, 11 October 2023 at 13:36:16 UTC, Paul wrote:
> On Wednesday, 11 October 2023 at 12:54:53 UTC, user1234 wrote:
>>
>> `extern(C)` on module level functions affect the mangling and 
>> the calling convention.
>>
>> - Mangling is used by the linker to link symbols between 
>> objects.
>> - Calling convention affects the compiler backend in how code 
>> is generated for a CALL instruction.
>
> So C doesn't use name mangling and extern (C) in a D prog would 
> turn off D mangling thereby allowing C and D object files to be 
> linked together?
>
> I didn't know C and D had different calling conventions...i.e. 
> different ABI's?

https://dlang.org/spec/abi.html


More information about the Digitalmars-d-learn mailing list