Date: Wed, 3 Mar 1999 08:39:46 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Shadow Seeker cc: djgpp AT delorie DOT com Subject: Re: Real stupid problem. In-Reply-To: <36dc14d8.14275007@news.tudelft.nl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Tue, 2 Mar 1999, Shadow Seeker wrote: > >If you need to minimize this padding (e.g., if your program uses large > >arrays of such structs, where padding will waste a lot of memory), lay > >out structures so that the longer members are before the shorter ones. > No, that won't do, I can't design the structs, I read datafiles that > use them. But Endlisnis gave me a clue that works perfectly. > > Just add "__attribute__(packed)" behind the struct and things work > just fine. It's "__attribute__((packed))" (double parentheses). This is all explained in the FAQ, btw.