Re:“What the Hardware Does” Is Not What Your Program Does: U...
by aarongolliver on Sunday July 14, 2019 @04:09PM
(#20435660)
Spent the week trying to figure out how to reimplement __builtin_add_overflow (et al) on Windows and boy is it a chore. The previous implementer had literally just used operator+ in a function called "safe_add" and I was dumbstruck.
Re:“What the Hardware Does” Is Not What Your Program Does: U...
by steveklabnik on Sunday July 14, 2019 @03:48PM
(#20435533)
Note that this isn’t UB in Rust.
Any code that handles signed integers is going to assume that overflow/underflow does not happen.