delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/07/10/11:47:00

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Question about Djgpp : Data Alignment
Date: 10 Jul 2003 15:41:43 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 14
Message-ID: <bek1fn$ckj$1@nets3.rz.RWTH-Aachen.DE>
References: <Pine DOT LNX DOT 4 DOT 44 DOT 0307092203070 DOT 23044-100000 AT ariel DOT minilab DOT bdeb DOT qc DOT ca>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1057851703 12947 137.226.32.75 (10 Jul 2003 15:41:43 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 10 Jul 2003 15:41:43 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

The Shadow <ericp AT ariel DOT minilab DOT bdeb DOT qc DOT ca> wrote:
> 	I want to know if it is possible to tell the compiler not to place
> any padding in data structures to allign the data on word or dword.

There is.  Two alternative methods exist, actually.

But note that quite a lot more often than not, using those methods is
the wrong way to fix the problem.  Which is that you should *never*
exchange data in raw binary format unless you very strictly have to.
And if you do use binary, struct packing alone addresses only a rather
small part of the actual portability problems that causes.
-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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