www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16466] New: Alignment of reals inside structs on 32 bit OSX

https://issues.dlang.org/show_bug.cgi?id=16466

          Issue ID: 16466
           Summary: Alignment of reals inside structs on 32 bit OSX should
                    be 16, not 8
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

The following fails on OSX 32 bit:
------------------------------
import core.stdc.stdio;

struct S
{
    real r;
}

int main()
{
    real r;
    printf("S.alignof: %x, r.alignof: %x\n", S.alignof, r.alignof);
    assert(S.alignof == r.alignof);
    return 0;
}
-------------------------------
S.alignof: 8, r.alignof: 10
core.exception.AssertError test.d(13): Assertion failure

--
Sep 04 2016