I agree with this. C and C++ would be better without UB. http://www.yodaiken.com/wp-content/uploads/2018/05/ub-1.pdf …
-
-
Replying to @filpizlo
I was thinking about this yesterday, but the hard question is what should out of bounds writes be specified to do? What about UAF? I don't see how to specify this without ruling out genuine optimizations (which is not to say that many of the dumb UB shouldn't be eliminated).
3 replies 0 retweets 3 likes -
yeah, there are several UBs that are hard to eliminate without changing these languages beyond recognition. this ship sailed long ago. we should focus on new languages but also on C/C++ dialects that don't aim for full back compatibility.
3 replies 2 retweets 8 likes -
Replying to @johnregehr @samth
I don’t think that’s right. The signed math UBs and strict aliasing are just dumb. You don’t need to replace the language to fix those.
3 replies 0 retweets 1 like -
I'm more talking about things like use of dead stack slots and to a much lesser extent, use of uninitialized storage
1 reply 0 retweets 0 likes -
since probably >95% of code suffers a negligible performance penalty if you just zero all allocations
4 replies 0 retweets 0 likes -
See musl's strstr for an example that suffers critically if you do.
1 reply 0 retweets 0 likes
We have a size_t array that would be noticeably costly to zero in many real use cases and instead use a validity bit array.
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.