Don wrote:
Stewart Gordon wrote:
<snip>
Surely, align isn't applicable to unions at all. IINM the members of a union, by design, start at the same offset.

Not so, the alignment of each member should be respected.

But the offset of a union member is always zero.  So what would this do?

Most obviously, a union U consisting of a single member x should have
U.alignof == x.alignof.
<snip>

Yes, by propagating the union's alignment (relative to the containing struct) to the member.

Stewart.

Reply via email to