Date: Mon, 6 Jan 1997 13:29:22 +0200 (IST) From: Eli Zaretskii To: Roland Nilsson cc: djgpp AT delorie DOT com Subject: Re: __attribute__((packed)) on types In-Reply-To: <5aopgf$31h@news.luth.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 5 Jan 1997, Roland Nilsson wrote: > Oh. Now it works, thanks. Only problem is that the structure size > still is expanded to a 4-byte boundary; The above structure would > have foo::a at offset 0, foo::b at 1, but sizeof(foo) returns 8. > But alright, this _is_ mentioned in the GCC manual. (Using the > -fpack-struct argument yields sizeof(foo) = 5, however.) That's because you can make an array of such structs, which still should be aligned to avoid runtime penalties.