//DMD 2.073.1 and latest 2.075.0-master-972eaed
//Windows 7 32-bit

union Union1
{
  align(1):
  byte[5] bytes5;
  struct
  {
    align(1):
    char char1;
    uint int1;
  }
}

void main ()
{
  import std.stdio: writefln;
  writefln("Union1.sizeof=%d", Union1.sizeof);  //prints 8, not 5
}

I expect size of Union1 is 5 (5 bytes == char + uint == 5).
Is this my bug or DMD?
Can anybody reproduce?

Reply via email to