[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bluetooth-dev] Re: Porting to ARM



Jonas Wigstein wrote:

> Hi all ARM porters !!!!
>
> I'm just wondering if anyone has a nice solution on the struct overlay
> problem?
> We have developed a bluetooth stack for windows and used a struct overlay
> technique similar to axis.
> Now we deeply regrets this technique because of the porting difficulties
> we faces.
> As we understands it the ARM processor cant fetch a word(2 byte) on an odd
> address and therefore the C-compiler inserts a space in our structs if it
> encounters a int_2 on a odd address and thereby destroying our nice
> structs.
>
> So does anyone know a C-compiler that can handle this on ARM or a nice way
> around the problem without a complete rewrite of the package processing?
>
> // Jonas Wigstein
>

gcc can handle it if you use __attribute__ ((packed)) on the guilty structs.
See 'info gcc' or http://gcc.gnu.org/onlinedocs/gcc_toc.html and search for
packed.

--Gordon