On Saturday, 25 March 2017 at 23:36:07 UTC, kinke wrote:
On Saturday, 25 March 2017 at 22:45:22 UTC, ketmar wrote:
zabruk70 wrote:

[...]

`align(1) union Union1` will do the trick.

what you did is members packing. but the union itself is padded to integer size too. i.e. internal `align` will set aligning for *members*, and external `align` will change padding of the whole thing.

The union should have an implicit alignment of 1 already though, right? It's defined as the maximum of all member alignments, and both the bytes5 array and the anonymous struct members have an explicit alignment of 1. The alignment of the anonymous struct's int1 member (explicitly 1 too) shouldn't even matter.

Why should it have an implicit alignment of 1? The alignment completely depends on the definition unless specified AFAIK.

Reply via email to