Date: Sun, 18 Aug 1996 19:02:20 +0200 Message-Id: <199608181702.AA28727@mail.umu.se> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: djgpp AT delorie DOT com From: hubble AT hem DOT passagen DOT se (Andreas Vernersson) Subject: What am i doing wrong? Could anyone explain this? typedef struct a { unsigned int q2 __attribute__((packed)); unsigned char qq __attribute__((packed)); } b; typedef struct a2 { unsigned int q2; unsigned char qq; } b2; void main() { printf("size: %d\n",(int)sizeof(b)); // 5 ??? printf("size: %d\n",(int)sizeof(b2)); // 8 ??? } ---- I only wants the datastructure to be 2+1=3 bytes...