www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/07/10:56:05

Date: Fri, 7 Jan 2000 15:22:38 +0100 (CET)
From: Wilmer van der Gaast <lintux AT dds DOT nl>
To: djgpp AT delorie DOT com
Subject: Re: Data padding?
In-Reply-To: <rVad4.105$Ee4.3982@nnrp2-w.snfc21.pbi.net>
Message-ID: <Pine.LNX.4.10.10001071521130.710-100000@syscon.minilinux.org>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 6 Jan 2000, Groman wrote:

> hi... I need help with DJGPP again.
> I have a struct...and I need djgpp to leave it the way I declare it without
> any padding or aligning it to machine words...

Modified version of the typedef:

typedef struct {
    unsigned int testing1;
    unsigned char testing2;
    unsigned short testing3;
    unsigned char testing 4;
} __attribute__ ((packed)) Lalala;
  ^^^^^^^^^^^^^^^^^^^^^^^^

It should work this way.

---------

Wilmer van der Gaast (lintux AT dds DOT nl)
ICQ 55707076

- Raw text -


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