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


bearophile_h...@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_h...@eml.cc


--- Comment #10 from bearophile_h...@eml.cc 2012-07-24 06:02:27 PDT ---
In DMD 2.060beta this problem seems partially solved, for structs:


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:
0
0
0
0



But this syntax is not supported yet:

void main() {
    align(16) ubyte u;
}

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

Reply via email to