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: jens dot ohlund at secrc dot abb dot se
- Subject: RE: [ECOS] Packed on a Arm Evaulation Board
- From: Gary Thomas <gthomas at redhat dot com>
- Date: Tue, 20 Jun 2000 08:36:12 -0600 (MDT)
- Cc: ecos-discuss at sourceware dot cygnus dot com
Try
struct ABC { ...whatever... } __attribute__ ((aligned(1), packed));
On 20-Jun-00 jens.ohlund@secrc.abb.se wrote:
> Hi!
>
> I'm having a problem, I can't find out how to align data on even bytes.
>
> That is, if I create a struct with 4 uint8 (unsigned char) I want the struct to be 8 bytes in
> size.
>
> Why ? It's a requirment for a jvm I try to run. I've tried with __attribute__ ((packed)), which I
> thought worked when I tried to
> make a struct with one byte, one short and one interger.
> But I had lots of "funny" errors so I checked it up a bit more just to se that that 2 unsigned
> chars used only 16 bit together, not
> 16 bits EACH.
>
> Anybody got any idea how I should do instead ?
>
> yours
> Jens Ohlund
>
>
>