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


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


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