[Olsr-dev] ARM Telefon

Sven-Ola Tücke (spam-protected)
Tue Aug 11 09:14:47 CEST 2009


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

// Sven-Ola




More information about the Olsr-dev mailing list