Don’t agree. The worst real-world problems are the security problems that appear constantly.
-
-
Replying to @pcwalton @johnregehr
now compare a security problem caused by a use-after-free, which is something well understood vs a security problem caused by an undefined behavior that happens somewhere silently because you upgraded your toolchain
2 replies 0 retweets 2 likes -
Replying to @mraleph @johnregehr
I agree that the latter is harder to debug, but the former has more real world impact simply because it occurs so much more frequently.
1 reply 0 retweets 5 likes -
Except when you realize signed integer bounds checking often invokes UB, which is sadly more common than I'd like
1 reply 0 retweets 1 like -
-
Solution: Stop using signed ints for array indices :)
1 reply 1 retweet 6 likes -
I agree. But tell that to compiler writers who recommend it, because the compiler can optimize it better.
1 reply 0 retweets 0 likes -
I don’t think there are any optimizations useful for arrays that depend on signedness. The main optzn here is loop trip count detection.
2 replies 0 retweets 1 like -
Compilers can assume signed integer never overflows, this use the most optimal indexing method. When you use unsigned, there are subtleties
2 replies 0 retweets 0 likes -
Replying to @matiasgoldberg @pcwalton and
the more obvious one is that a 8/16/32-bit index in a 64-bit system requires additional logic because it doesn't overflow at 0xfffffffffffff
2 replies 0 retweets 0 likes
In Rust we address that (effectively) by using size_t for all indices so the arithmetic is done in the native word size to begin with
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.