delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/07/28/11:24:05

Date: Fri, 28 Jul 1995 17:51:45 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: GCC/DJGPP Weirdness (structure padding stuff)

On Fri, 28 Jul 1995, A.Appleyard wrote:

> Why not pack structs etc anyway by default? On a PC, (rounding every member's
> width to a multiple of 2 or 4 bytes) achieves nothing except wasting store and
> annoying people who want to make a struct match some assembly-coded table (as
> e.g. when calling some interrupts).

This is not true.  There is a considerable penalty on a 486 or better CPU 
for unaligned accesses, so even on a PC struct padding makes a lot of 
sense.  However, if you want this feature to be the default, you can edit 
your lib/specs file and add this switch.  (You should recompile the 
library before you can link your programs compiled with that switch, and 
anyway we don't have Gcc 2.7.x yet.)

- Raw text -


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