Bug 5439 – 64bit struct alignment inconsistent with C ABI
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2011-01-09T11:03:00Z
Last change time
2015-06-09T05:12:03Z
Assigned to
nobody
Creator
ibuclaw
Comments
Comment #0 by ibuclaw — 2011-01-09T11:03:22Z
This was caused by bug2821. On 64bit, doubles are 8-byte aligned, not 4, so
struct { long, short }
Should have a sizeof = 16, not 12.
Btw, would be nice if you offered a -malign-double type flag to say "Yes, I want 8 byte aligned doubles on 32bit Linux" :)
Regards
Comment #1 by ibuclaw — 2011-01-09T11:05:08Z
To save you searching for it, lookup "TypeBasic::alignsize"