| |
| Posted by user1234 in reply to Paul | PermalinkReply |
|
user1234
| On Wednesday, 11 October 2023 at 12:36:58 UTC, Paul wrote:
> What does the extern (c) attribute(?) do?
Does it tell the compiler/linker to build the function like a C compiler would build a C function? If so what does that mean?
Does it tell the compiler/linker to let C functions know it exists? If so what does that mean?
Is it meant for the compiler or linker or both?
Thanks for any assistance.
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.
|