http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51568

Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Richard Earnshaw <rearnsha at gcc dot gnu.org> 2011-12-15 
17:17:34 UTC ---
On linux sizeof (struct rec) is 7, so how do you expect an unsigned (size = 4)
to hold the entire value?

If you want a packed enum, you need to specify the packed on the element
declaration, not just on the overall structure:

struct rec {
  unsigned short w;
  unsigned char  c;
  enum en e __attribute__((packed));
} __attribute__((packed));

Reply via email to