Date: Thu, 10 Apr 1997 16:57:21 -0300 Message-Id: <9704101957.AA25116@eed.miee.ru> From: "Oleg Yu. Polyanski" To: Anthony DOT Appleyard AT umist DOT ac DOT uk Cc: djgpp AT delorie DOT com Subject: Re: Problem with Packed structs In-Reply-To: <6604EA689A@fs2.mt.umist.ac.uk> References: <6604EA689A AT fs2 DOT mt DOT umist DOT ac DOT uk> Anthony Appleyard writes: > On Mon, 7 Apr 1997, Mark T Logan wrote: > > I have a slight problem with the way that DJGPP packs its structs. ... > > "Adrian Gh. Oboroc aka AsH / DEVOTiON" wrote:- > > You might want to use '#pragma pack' method: > > > > #pragma pack(1) > > struct Heroin ////// Lets keep this stuff out of it!!!!!!! > > { > > char dealer[100]; > > int quality; > > double weight; > > } > > #pragma pack() > > > > but guys from FSF, who develops GCC, don't like pragmas, thus you'll get > > some warnings at compilation stage. > > and thus you likely won't get any packing effect either. I put > #define pk __attribute__((packed)) > at the start of my programs, so it is easy to put `pk' before every `;' > inside the struct {brackets}. .... or add -fpack-struct option to gcc. -- Sincerely yours, necrofriend.