--- In lpc2000@yahoogroups.com, "rtstofer" <rstofer@p...> wrote:
>
> --- In lpc2000@yahoogroups.com, Richard Duits <yahoo@r...> wrote:
> >
> > If you use an "__attribute__((packed))" structure with GCC, the
> compiler
> > assumes it is not aligned and reads everything one byte at a
time
> (even
> > if it is aligned).
> >
> > Richard Duits.
>
> Thanks! I'll give it a try right now.
> Richard
>
Initially I had no success but on reflection I realized the example
was too large to test.
I created a small structure
struct frame {
unsigned char b;
unsigned short w; // misaligned
unsigned int d; // misaligned
} __attribute__ ((packed));
and worked with that. The __attribute__ does solve my problem. Now
I need to rework the structures...
Thanks!
RichardMessage
Re: Confused re: endianness
2005-10-19 by rtstofer
Attachments
- No local attachments were found for this message.