netlink.c:97: error: cast increases required alignment of target type

Rémi Denis-Courmont remi at remlab.net
Mon Nov 9 09:27:04 PST 2009


Le lundi 9 novembre 2009 17:45:25 andrzej zaborowski, vous avez écrit :
> Hi,
> resurrecting this thread because I think there's no reason ofono
> should not build on cpus with strict alignment rules, the netlink code
> is actually aligned correctly.  These warnings are a result of
> -Wcast-align, the compiler can't know that the casts in the macros are
> safe, but they obviously are if you look at the arithmetics there.  In
> the case of the netlink warnings they can be turned off for all users
> of <linux/netlink.h> using a pragma or only for this cast by casting
> to void * first (the only way according to gcc people), the first
> attached file adds them (against linux), I'll send it to linux if
> there's no better idea.  There are also similar warnings when casting
> struct sockaddr_pn * to struct sockaddr * and these can be worked
> around in ofono, see second patch, but probably should also be in
> linux's include/linux/phonet.h instead.

Why do you change the sockaddr_pn type name?!

-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the ofono mailing list