Why is the ABI for structs different between Linux and Windows?

Robert Fraser fraserofthenight at gmail.com
Sat May 17 14:45:48 PDT 2008


Walter Bright wrote:
> Robert Fraser wrote:
>> Walter Bright wrote:
>>> Robert Fraser wrote:
>>>> Walter Bright wrote:
>>>>> The struct ABI is designed to be compatible with the C struct 
>>>>> behavior for the local C compiler.
>>>>
>>>> Is it possible to just use this behavior for extern(C) structs while 
>>>> structs with D linkage use the Windows behavior on Linux, too?
>>>
>>> Why do that? You can control the layout with the align attribute, if 
>>> need be.
>>
>> How would that allow an 8-byte struct to be passed in registers on Linux?
> 
> You can do that now if you use the D function calling convention. Using 
> extern(C) gives you the C calling convention.

*returned... Don's original question that started the topic.



More information about the Digitalmars-d mailing list