[Bug c/82105] unexpected padding in a struct

dudu.arbel at ilrd dot co.il gcc-bugzilla@gcc.gnu.org
Tue Sep 5 11:51:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82105

--- Comment #2 from Dudu <dudu.arbel at ilrd dot co.il> ---
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 this case:
typedef struct {
        unsigned int x:16;
        unsigned int y:16;
        unsigned short z;
} XXX;


More information about the Gcc-bugs mailing list