From: "A.Appleyard" Organization: Materials Science Centre To: djgpp AT delorie DOT com Date: Mon, 9 Dec 1996 08:25:49 GMT Subject: Re: Padding Question Message-ID: <40009E0A62@fs2.mt.umist.ac.uk> Rohit Jalan wrote (Subject: Padding Question):- > Is it possible to stop gcc from padding structures ? At the top of the program put this line:- #define pk __attribute__((packed)) Then, when you declare the struct or class, insert the word pk next before every `;' that comes at the end of a member declaration, e.g.:- typedef struct{long di,si,bp,res,bx,dx,cx,ax pk; short flags,es,ds,fs,gs,ip,cs,sp,ss pk;} Regs; class dirbuf{public:byte Reservebuf[21],attrib pk; FCBtime time pk; FCBdate date pk; uns long size pk; char name[13] pk; dirbuf(); byte GetFirst(char*dirname, uns int attrib=~0); byte GetNext(); int get(char*name);};