delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/11/10/22:11:38

From: jjf AT dsbc DOT icl DOT co DOT uk (J.J.Farrell)
Subject: Re: FW: Re: wxwin port
10 Nov 1996 22:11:38 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199611102333.6951.0.cygnus.gnu-win32@dsbc.icl.co.uk>
Original-To: garp AT opustel DOT com (Keith Gary Boyce)
Original-Cc: gnu-win32 AT cygnus DOT com
In-Reply-To: <Chameleon.847611180.garp@garp.worldnet.att.net> from "Keith Gary Boyce" at Nov 10, 96 02:32:01 am
X-Mailer: ELM [version 2.4 PL23]
Original-Sender: owner-gnu-win32 AT cygnus DOT com

> From: Keith Gary Boyce <garp AT opustel DOT com>
> 
> Does anyone have any input on why 16 bytes from gnu-win32 and
> 14 for other compiler
> 
> >typedef struct tagBITMAPFILEHEADER {
> >        WORD    bfType;
> >        DWORD   bfSize;
> >        WORD    bfReserved1;
> >        WORD    bfReserved2;
> >        DWORD   bfOffBits;
> >} BITMAPFILEHEADER, FAR *LPBITMAPFILEHEADER, *PBITMAPFILEHEADER;
> 
> WORD is 16 bits=2 bytes, DWORD is 32 bits=4 bytes, so this is
> 
> 3 * 2 + 2 * 4 = 14

The C language allows compilers to add padding between structure
members and at the end of a structure as they see fit. It looks
like the compilers you are using have different views on what is
fitting! You cannot portably determine the size of a structure
from the sizes of its members. The documentation should include
information on how the compiler does this padding.

Regards,
		jjf
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019