Where is your prototype for your log function?
Alignment cast warnings work like this
Code:
void foo ( double *p ) {
*p = 0;
}
int main ( ) {
unsigned char v[sizeof(double)];
foo( (double*)v );
}
Now whilst v has enough bytes to store a double, it may be aligned on a byte boundary, and not a double boundary.
As such, when you try to dereference the pointer in foo, it will be an invalid address and the program will just crash.
The correct way to convert a struct prefix into a struct in_addr would be to do something like
Code:
struct in_addr temp = { 0 };
memcpy( temp.in6.addr32, p, sizeof(*p) );
log(..., temp.in6.addr32 ... );