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

andrzej zaborowski balrogg at gmail.com
Mon Nov 9 09:57:07 PST 2009


2009/11/9 Rémi Denis-Courmont <remi at remlab.net>:
> As far as I know NO extra alignement is needed. The kernel will anyway memory
> copy from/to the sockaddr_pn buffer as part of the socket calls, so it
> couldn't care less about alignment.

Practically I'm sure you're right and maybe we should stick a (void *)
cast in between the casts or disable the warning.  Formally that
memcpy is an implementation detail and could be true in one kernel
version and false in the next version, so when you pass a struct
sockaddr * to a function it should, in theory be aligned as such.

Regards


More information about the ofono mailing list