Mail Archives: cygwin/1996/11/10/22:11:38
> 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 -