https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82105
--- Comment #9 from Dudu ---
So, Andreas, why this struct's size is 16?
typedef struct
{
long x:16;
int y:17;
short z;
} SizeofThisIs16;
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82105
--- Comment #8 from Andrew Pinski ---
(In reply to Dudu from comment #7)
> By the way: if you use long instead of int - you get no padding between x
> and y, so the size of the struct is smaller!!!
>
> typedef struct {
> unsigned long x:16
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82105
--- Comment #7 from Dudu ---
By the way: if you use long instead of int - you get no padding between x and
y, so the size of the struct is smaller!!!
typedef struct {
unsigned long x:16;
unsigned long y:17;
unsigned short
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82105
--- Comment #6 from Dudu ---
Thanks for the replies, but I do not look to workaround this issue.
I simply wonder why gcc behaves as it does on this case.
This behavior breaks my understanding of padding.
This behavior seems wrong.
This behavior l
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82105
Eric Gallager changed:
What|Removed |Added
CC||egallager at gcc dot gnu.org
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82105
--- Comment #4 from Dudu ---
Sorry, Andreas
I don't understand your comment - can you please explain?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82105
--- Comment #3 from Andreas Schwab ---
Bit fields are not allocated across unit boundaries.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82105
--- Comment #2 from Dudu ---
I don't think this is how bitfields works.
In the following structs there are no padding between x an y
typedef struct {
unsigned int x:1;
unsigned int y:1;
unsigned short z;
} XXX;
nor in th
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82105
Richard Biener changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---