Modern C compilers incompatible with modern C sockets APIhttps://twitter.com/spun_off/status/750601013791432704 …
-
-
Replying to @fanf
@antumbral This is really not true. In the modern sockets API you never dereference any sockaddrs. struct sockaddr * is an opaque type1 reply 0 retweets 0 likes -
Replying to @RichFelker @antumbral
the problem occurs with low-level address manipulation when you can't treat it as a unit https://tools.ietf.org/html/rfc3493
2 replies 0 retweets 1 like -
Replying to @fanf @antumbral
Then you just use memcpy rather than buggy type-punning hacks.
2 replies 0 retweets 0 likes -
Replying to @RichFelker @fanf
I keep seeing this explanation, as if having to memcpy constantly isn't 1) toxic to performance 2) error-prone 3) a pain
2 replies 0 retweets 0 likes -
Replying to @antumbral @fanf
Any remotely modern compiler inlines small constant-sized memcpys as efficient loads/stores.
3 replies 0 retweets 0 likes
For copying dns/etc. results into sockaddr_in[6] you need memcpy anyway since src is your packet buffer, not ='able type.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.