fd1ca762e9
While we know that "struct sockaddr_storage" has been engineered to alias to all the sockaddr structs, the compiler does not know about this. Thus, code like this may be unsafe to use: struct sockaddr_storage ss; struct sockaddr_in *sin = &ss; sin->sin_port = 0; /* dereferencing here breaks ISO C aliasing rules */ A workaround is to wrap the struct in a union, e.g: union anonymous { struct sockaddr_storage ss; struct sockaddr_in sin; } u; u.sin.sin_port = 0; -- Approved by: joerg |
||
---|---|---|
.. | ||
common.c | ||
common.h | ||
errlist.sh | ||
fetch.3 | ||
fetch.c | ||
fetch.cat3 | ||
fetch.h | ||
file.c | ||
ftp.c | ||
ftp.errors | ||
http.c | ||
http.errors | ||
Makefile |