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

           Summary: Inconsistency in aligning named and anonymous structs
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: m.stras...@gmail.com


--- Comment #0 from Mihail Strashun <m.stras...@gmail.com> 2012-08-20 05:47:51 
PDT ---
Code sample:

=================================================
import std.stdio;

union Anonymous {
        char[9] buffer;
        align(1) struct {
                align(1):
                        int a;
                        int b;
                        char c;
        }
}

union Named {
        char[9] buffer;
        align(1) struct Name {
                align(1):
                        int a;
                        int b;
                        char c;
        }
}
void main() {
        writeln(Named.sizeof);
        writeln(Anonymous.sizeof);
}

=================================================

Output:
9
12

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

Reply via email to