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 -
Replying to @RichFelker @fanf
it shouldn't need to bounce off memory or stack at all.
1 reply 0 retweets 0 likes -
Replying to @antumbral @fanf
It needs not hit memory if there's no mem buffer; see https://godbolt.org/g/oHA3hv (using ancient gcc even).
1 reply 0 retweets 1 like -
Replying to @RichFelker @fanf
That's a nice optimization. Wonder how reliable it is at scale...
1 reply 0 retweets 0 likes
I think it's very reliable because __builtin_memcpy is just modeled as "may_alias" access/assignment.
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.