>It's unclear to me why our languages still default to modulo arithmetic semantics.
Because that's what processors do? (leaving aside backwards compatibility issues)
Because that's what processors do? (leaving aside backwards compatibility issues)
The whole point of higher level programming languages is to abstract away the fiddly bits of dealing with processors that we don't want to have to deal with.
This is one of those cases.
So basically, don't forget to test with UBSan.
(I don't like -fno-strict-overflow as a solution, because defining incorrect behavior isn't much better than undefined behavior.)