3 ms·
It would break my current usage of unions. typedef union { struct sockaddr sa; struct sockaddr_in sin; struct sockaddr_in6 sin6;
by spc476 13y ago
It would break my current usage of unions.
typedef union
{
struct sockaddr sa;
struct sockaddr_in sin;
struct sockaddr_in6 sin6;
} addr__u;
as a way to work around the BSD socket API without horrible casting all over the place. Change the "union" to a "struct" and the code no longer works. Is it subverting the type system? Yes. Is casting subverting the type system. Yes. Pick your poison.