[Olsr-dev] ARM Telefon
Henning Rogge
(spam-protected)
Thu Aug 13 09:34:33 CEST 2009
Am Tue August 11 2009 09:14:47 schrieb Sven-Ola Tücke:
> Ah - sorry. Wrong list - wrong language.
>
> Olsrd should run on an ARM CPU to my knowledge. So I have installed a
> typical build tool chain on my new Android Mobile. When I start make, there
> are lots of Warnings stating: "src/ipcalc.c:164: error: cast increases
> required alignment of target type". If I start olsrd, it shows "BUS error"
> after a short time. Well - those warnings are obviously serious.
>
> OK - some pointer magic added to overcome the warnings. Does anybody know
> some background to this (I'm not an ARM freak). I think about something
> like this:
>
> diff -r a651cc474e85 src/common/list.h
> --- a/src/common/list.h Sun Aug 09 09:00:01 2009 +0200
> +++ b/src/common/list.h Tue Aug 11 07:09:12 2009 +0000
> @@ -136,7 +136,7 @@
> {\
> return( \
> ptr ? \
> - (structname *) (((uint8_t *) ptr) - offsetof(structname,
> listnodename))
>
> : \
>
> + (structname *) (((size_t) ptr) - offsetof(structname, listnodename))
> : \ NULL); \
> }
>
> diff -r a651cc474e85 src/lq_packet.h
> --- a/src/lq_packet.h Sun Aug 09 09:00:01 2009 +0200
> +++ b/src/lq_packet.h Tue Aug 11 07:09:12 2009 +0000
> @@ -126,7 +126,7 @@
> static INLINE void
> pkt_get_u16(const uint8_t ** p, uint16_t * var)
> {
> - *var = ntohs(*(const uint16_t *)(*p));
> + *var = ntohs(**((const uint16_t **)p));
> *p += sizeof(uint16_t);
> }
> static INLINE void
And the pkt_get_u32 is totally broken (and unused ^^).
Thanks for catching this.
Henning
*************************************************
Diplom Informatiker Henning Rogge
Forschungsgesellschaft für
Angewandte Naturwissenschaften e. V. (FGAN)
Neuenahrer Str. 20, 53343 Wachtberg, Germany
Tel.: 0049 (0)228 9435-961
Fax: 0049 (0)228 9435-685
E-Mail: (spam-protected)
Web: www.fgan.de
************************************************
Sitz der Gesellschaft: Bonn
Registergericht: Amtsgericht Bonn VR 2530
Vorstand: Dr. rer. nat. Ralf Dornhaus (Vors.), Prof. Dr. Joachim Ender
(Stellv.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.olsr.org/pipermail/olsr-dev/attachments/20090813/ff48050c/attachment.sig>
More information about the Olsr-dev
mailing list