This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
Re: Packed on a Arm Evaulation Board
- To: Gary Thomas <gthomas at redhat dot com>
- Subject: Re: [ECOS] Packed on a Arm Evaulation Board
- From: Jonathan Larmour <jlarmour at redhat dot co dot uk>
- Date: Tue, 20 Jun 2000 16:20:08 +0100
- CC: jens dot ohlund at secrc dot abb dot se, ecos-discuss at sourceware dot cygnus dot com
- Organization: Red Hat UK Ltd.
- References: <XFMail.000620083612.gthomas@redhat.com>
Gary Thomas wrote:
>
> Try
>
> struct ABC { ...whatever... } __attribute__ ((aligned(1), packed));
I've found from experience that you can't mix the aligned and packed
attributes. Also the aligned attribute only describes the alignment of the
structure, not of the fields inside it (For Gary's benefit, read the thread
subject "eCos 1.3.5 branch" around 4th/5th May from our internal lists).
Individual members of a struct can also
have __attribute__((packed)) on them, e.g. from gcc.info:
Here is a structure in which the field `x' is packed, so that it
immediately follows `a':
struct foo
{
char a;
int x[2] __attribute__ ((packed));
};
Jifl
--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault