www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/14/03:03:15

Xref: news2.mv.net comp.os.msdos.djgpp:4953
From: mwood AT indyvax DOT iupui DOT edu (Mark H. Wood)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: bmp file format
Message-ID: <1996Jun13.120550.25435@indyvax.iupui.edu>
Date: 13 Jun 96 12:05:50 -0500
References: <199606111539 DOT IAA08233 AT netcom9 DOT netcom DOT com>
Lines: 15
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <199606111539 DOT IAA08233 AT netcom9 DOT netcom DOT com>, elf AT netcom DOT com (Marc Singer) writes:
> There is a design flaw in the BMP file format.  They chose to misalign
> the BMPFILE structure such that the first WORD which contains the
> letters "BM" can cause the rest of the structure to be offset by two
> bytes.  The latest GNU C compiler (I believe) does not handle the
> alignment attribute correctly, so you have to either write the first
> two bytes and then the rest of the structure, or you may need to
> switch compilers.

Or litter your code with __attribute__ ((packed)) like I've been doing lately.
I don't suppose there's an -fall_structs_packed that I missed?
-- 
Mark H. Wood, Lead Systems Programmer    +1 317 274 0749   [@disclaimer@]
Internet:  MWOOD AT INDYVAX DOT IUPUI DOT EDU       BITNET:  MWOOD AT INDYVAX
Trapped in a world he never made.

- Raw text -


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