Calling conventions

Jacob Carlborg doob at me.com
Thu Oct 18 23:30:51 PDT 2012


On 2012-10-18 21:56, David Nadlinger wrote:

> There is no single »C calling convention«, it varies between different
> OSes and architectures. But yes, as far as I know the calling convention
> used by GDC for extern(D) is the same as GCC (the C compiler) defaults to.

Hence the "or whatever the calling convention used by the system". I 
know that VC on Windows uses a different calling convention (__stdcall), 
don't know that mingw uses.

> All those differences should definitely be fixed, at least for x86_64
> and future platforms like ARM, because an unified ABI is definitely a
> very good thing to have – C++ continues to suffer dearly for not
> specifying one. But this is only going to happen if all three compiler
> implementations are actively working together.

I think it would be great if those working with the compilers, LDC, GDC 
and Walter (DMD) would discuss this and try to fix it. Currently Walter 
only seems to care about the targets supported by DMD and it's up to the 
other compiler developers to invent their own ABI for the other 
platforms. What happens then when a new platform is added to DMD, will 
Walter follow the other compilers (are the even consistent?) or role his 
own ABI.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list