[LLVMbugs] [Bug 12506] wrong Sizeof struct
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Apr 9 12:21:00 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=12506
Benjamin Kramer <benny.kra at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |benny.kra at gmail.com
Resolution| |INVALID
--- Comment #1 from Benjamin Kramer <benny.kra at gmail.com> 2012-04-09 14:21:00 CDT ---
The x86_64 ABI requires doubles to be aligned on a 8 byte boundary (the address
has to be a multiple of 8). In your example the compiler adds 4 bytes of
padding to ensure that.
You can pass -Wpadded to clang and it will warn you when it inserts padding
bytes.
http://en.wikipedia.org/wiki/Data_structure_alignment#Data_structure_padding
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list