3 ms·
Right, but it is not the plus operation that does this. You can reserve undefined behaviour to things like "write to a bad pointer". Then a particular ABI cou
by adrianratnapala 9y ago
Right, but it is not the plus operation that does this. You can reserve undefined behaviour to things like "write to a bad pointer".
Then a particular ABI could say "if your pointer overflows (by a our system specific meaning of overlow) then you have a bad pointer". Merely doing a pointer increment just gets you implementation-defined behaviour. The UB only happens if you plough on.
Such a setup wouldn't do much to save us from pointer bugs. But it would make optimizers more predictable.