On Friday, 13 November 2015 at 06:46:37 UTC, Ali Çehreli wrote:
Since it's UB in C and C++, I've heard that both clang and gcc do remove code branches if they can prove that there will be signed overflow. I don't know how or whether that optimization is turned off for D.

The question you want to ask is probably if modular arithmetics is legal D code for all integers, signed and unsigned. Can the programmer assume that wrapping is legal D code?

If so, then D does not have any kind of integer overflow at all, by definition.

Reply via email to