This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: structure size
- From: Gary Thomas <gary at mlbassoc dot com>
- To: Aravind B <arvindb at cranessoftware dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: 04 Jan 2004 21:22:49 -0700
- Subject: Re: [ECOS] structure size
- Organization: MLB Associates
- References: <1073272910.1377.2.camel@ambica>
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