This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37119] sizeof simple struct consisting of bit-fields too large and unpredictable
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Aug 2008 21:59:42 -0000
- Subject: [Bug c++/37119] sizeof simple struct consisting of bit-fields too large and unpredictable
- References: <bug-37119-5473@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from rguenth at gcc dot gnu dot org 2008-08-13 21:59 -------
Seems like we do that since forever, so we cannot change this anyway. But
surely it looks unintuitive that
struct X { uint32_t a:17; uint16_t b:8; uint8_t c:1; };
is 4 bytes while
struct X { uint32_t a:17; uint8_t b:8; uint8_t c:1; };
is 8 bytes in size.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org, matz at gcc dot gnu dot
| |org
GCC host triplet| |x86_64-pc-linux
GCC target triplet|x86_64-pc-linux-gnu |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37119