This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/32016] sizeof(class) always a multiple of 4 on 32 bit machine
- From: "pbrook at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 May 2007 22:55:58 -0000
- Subject: [Bug c++/32016] sizeof(class) always a multiple of 4 on 32 bit machine
- References: <bug-32016-9370@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from pbrook at gcc dot gnu dot org 2007-05-21 23:55 -------
On arm-elf structures are padded/aligned to a 4-byte boundary. This is a
"feature" of the ABI. The microsoft compiler obviously conforms to a different
ABI, which is why you get different results. Both are "correct".
Any code that relies on a particular structure layout or size is inherently
unportable.
EABI based targets (eg. arm-eabi) use a more conventional ABI.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32016