[Issue 2648] New: Unnecessary struct ABI inconsistency

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 6 02:40:34 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2648

           Summary: Unnecessary struct ABI inconsistency
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: clugdbug at yahoo.com.au


There is a horrible ABI difference between Linux and Windows which seems to be
completely unjustified. Although extern(C) needs to be different between the
systems, there's no reason for extern(D) to.

Linux and Windows should use the same return algorithm for 1,2,4, and 8-byte
structs. This is the only point at which the ABI differs (except for the fact
that real.sizeof is different, but that's something dictacted by the OS).

---
# For Windows, 1, 2 and 4 byte structs are returned in EAX.
# For Windows, 8 byte structs are returned in EDX,EAX, where EDX gets the most
significant half.
# For other struct sizes, the return value is stored through a hidden pointer
passed as an argument to the function.
---


-- 



More information about the Digitalmars-d-bugs mailing list