This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: structure size


Hi,

    Although your answer is a 'better' solution in that it gives a developer
more power over individual structures, I thought it would be interesting to
turn it on once for an entire module.

so...Are pragma's supported?  Specifically, #pragma pack 1.

I looked at the documentation page (preprocessor directives, pragmas..etc)
and checked the archive, but only found one post related to pragmas and
packing.

William


----- Original Message ----- 
From: "Gary Thomas" <gary@mlbassoc.com>
To: "Aravind B" <arvindb@cranessoftware.com>
Cc: <ecos-discuss@sources.redhat.com>
Sent: Sunday, January 04, 2004 9:22 PM
Subject: Re: [ECOS] structure size


> On Sun, 2004-01-04 at 20:21, Aravind B wrote:
> > hi,
> > i have used structure whhich has char short int as its member.
> > if i take its sizeof it is giving me some extra bytes.
> > is there any soln to get rid of it.
>
> Try using packed attributes.
>   struct xyz {
>     ...
>   } __attribute__ ((aligned(1), packed));
>
> -- 
> Gary Thomas <gary@mlbassoc.com>
> MLB Associates
>
>
> -- 
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>



-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]