Mail Archives: djgpp/2002/06/27/14:00:10

From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How to align members/data under gcc/DJGPP?
Date: Thu, 27 Jun 2002 18:28:53 +0100
Lines: 30
Message-ID: <>
References: <96eb2770 DOT 0206270530 DOT 3d2253dc AT posting DOT google DOT com> <3d1b37f1$1 AT news DOT infonet DOT ee>
Mime-Version: 1.0
X-Trace: 1025200536 20409 (27 Jun 2002 17:55:36 GMT)
NNTP-Posting-Date: 27 Jun 2002 17:55:36 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19 i586)
X-Accept-Language: de,fr
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com


Tonu Aas wrote:
> > I can't find in FAQ (sorry, maybe I missed it), how to align struct
> > members under gcc/DJGPP? What is pragma/option doing this?
> I use header files for that:
> struct aligned_struct
>  {
>   char    a_default;
> #include "align4.h"
>   char    a_4;
> #include "popalign.h"
>   char    aa_default;
>  }
> Works well with several compilers so far... (also gcc)

__attribute__ should be preferred over #pragma, when using gcc. See the end of
this info page for the reasons:

    info gcc 'c extensions' 'function attributes'


Richard Dawe [ ]

- Raw text -

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