> -----Original Message-----
> From: Gordon McNutt [mailto:gmcnutt@ridgerun.com]
> Sent: Thursday, September 14, 2000 6:58 PM
> To: ipaq@handhelds.org
> Subject: Re: FW: [iPAQ] skiff tools question
>
>
> George France wrote:
>
> > Correction:
> >
> > struct foo_t { u16 x; } __attribute__ ((packed));
> >
> > Best Regards,
> >
> > --George
>
> I hope it's something that simple. But the following example makes me
> worry that it is not, as this example does not use structs:
>
> u8 buf[4];
> u16 *a;
> a = &buf[1];
> *a = 4;
>
> Printing the contents of buf shows one thing on the ARM:
>
> 0xbffffc40 = 0x4
> 0xbffffc41 = 0x0
> 0xbffffc42 = 0x0
> 0xbffffc43 = 0x0
>
> and another on the i386:
> 0xbffff914 = 0x0
> 0xbffff915 = 0x4
> 0xbffff916 = 0x0
> 0xbffff917 = 0x0
>
> It appears that on the ARM, the address of a variable is the last byte
> of the variable, but on the i386 it is the first. It seems that this
> makes overlaying structs non-portable.
>
> Thanks,
> --Gordon
Hello Gordon;
Please, try something simple for me, on ARM and i86, printk the sizeof(buf),
then send me the results.
I will help you more tomorrow.
Best Regards,
--George
Received on Thu Sep 14 16:16:26 2000
This archive was generated by hypermail 2.1.8 : Tue May 04 2004 - 09:43:42 EDT