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

            Bug ID: 93476
           Summary: int bit fields waste space
           Product: gcc
           Version: 7.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doug at cs dot dartmouth.edu
  Target Milestone: ---

sizeof(struct{ unsigned int a:2; }) is 4. 3 out of the 4
bytes are gratuitously wasted.

A workaround is struct{ unsigned char a:2; }, whose size is 1,
but this is implementation-defined syntax and not portable.

Reply via email to