Date: Thu, 4 May 2000 17:14:13 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Alexandre Devaure cc: djgpp AT delorie DOT com Subject: Re: structures size In-Reply-To: <_EdQ4.3797$VI7.8365112@nnrp5.proxad.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 4 May 2000, Alexandre Devaure wrote: > > What did you expect this program to print? > > I forgot to include the definition of the types used in the structures : > typedef unsigned short uint; > typedef unsigned char uchar; > typedef unsigned int ulong; > > And I want the size to be 15 bytes. It works for me, but not with GCC 2.95.x, which has a bug when you use the -fpack-struct switch, as explained in the FAQ. If you have that version of GCC, you will have to use __attribute__((packed)) instead. See section 22.11 of the DJGPP FAQ for more details.