[Bug 226] Union alignof is less than the alignof for each of its fields

via D.gnu d.gnu at puremagic.com
Sat May 21 01:29:22 PDT 2016


http://bugzilla.gdcproject.org/show_bug.cgi?id=226

--- Comment #3 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to Iain Buclaw from comment #2)
> NB: There is Target::fieldalign which allows other compilers to implement
> this independently.  So it's *not* a front-end bug per-say.

Ah wait, I initially misread it.  It's not Target::fieldalign that is wrong,
it's Target::typealign that is wrong in the other compilers!  As all compilers
get the align of the union correct, but the align of the individual types
wrong.


printf("%d:%d:%d\n", alignof(Foo), alignof(double), alignof(ulong));
=> 4:8:8

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the D.gnu mailing list