This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Alignment of Variables
- To: gnu-win32 at cygnus dot com
- Subject: Alignment of Variables
- From: Thomas dot Irlet at x400 dot gr dot admin dot ch
- Date: 14 Apr 1998 13:25:38 +0000
- Autoforwarded: FALSE
- Discarded-X400-Mts-Extensions: (43) (12) (2) (135) (115) (5) (6) (1)
- Original-Encoded-Information-Types: (1) (0) (10021) (7) (1) (0) (6), (1) (0) (10021) (7) (1) (0) (1)
- X400-Content-Type: P2-1988 (22)
- X400-Mts-Identifier: [/PRMD=emd/ADMD=admin/C=ch/;D252E4C111D1D3AC00AA8DBF]
- X400-Originator: Thomas.Irlet@x400.gr.admin.ch
- X400-Received: by mta grmail in /PRMD=emd/ADMD=admin/C=ch/;Relayed; 14 Apr 1998 13:25:40 +0000
- X400-Received: by mta GRDMTA in /PRMD=emd/ADMD=admin/C=ch/;Relayed; 14 Apr 1998 13:25:38 +0000
- X400-Recipients: gnu-win32@cygnus.com
I am using EGCS V1.0 with the MINGW32 Headers. Now I have a problem wi
th the alignment of variables in the structure "BITMAPFILEHEADER". The
structure is defined as
typedef struct tagBITMAPFILEHEADER {
WORD bfType;
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
} BITMAPFILEHEADER;
My problem was now, that the compiler aligns all variables to their na
tural boundaries, that is WORD to wordbouderies, DWORD to longbounderi
es. To achieve this, a dummy WORD is inserted after bfType. To read in
a BMP-file, this scrambles the whole header.
What can I do to prevent the compiler to "optimize" this structures. A
re there any "PRAGMA"'s, that could be used. A compilerswitch is not s
o preferable, because in this case, very structure stays unoptimized.
Thanks for any tip
Thomas Irlet
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".