[Issue 2278] Guarantee alignment of stack-allocated variables on x86

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 15 15:48:04 PDT 2013


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


Temtaime <temtaime at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |temtaime at gmail.com


--- Comment #11 from Temtaime <temtaime at gmail.com> 2013-08-15 15:47:59 PDT ---
BUMP.

2.63.2 regression ?

import core.stdc.stdio: printf;
align(16) struct Foo { ubyte u; }
// struct Foo { ubyte u; } // try this
void main() {
    Foo f1;
    ubyte[3] b1;
    Foo f2;
    ubyte[5] b2;
    Foo f3;
    ubyte[7] b3;
    short s1;
    Foo f4;
    printf("%u\n", cast(size_t)&f1 % 16);
    printf("%u\n", cast(size_t)&f2 % 16);
    printf("%u\n", cast(size_t)&f3 % 16);
    printf("%u\n", cast(size_t)&f4 % 16);
}

Output:
8
8
8
8

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list