4 ms·
My go-to example of "UB is everywhere" is this one: int increment(int x) { return x + 1; } Which is UB for certain values of x.
by kzrdude 5mo ago
My go-to example of "UB is everywhere" is this one:
int increment(int x) {
return x + 1;
}
Which is UB for certain values of x.
- CodeArtisan 5mo agoC23 removed the whole stuff about indeterminate value and trap representation. Underflow/overflow being silent or not is implementation defined.
- saagarjha 5mo agoSigned overflow is just undefined.
- jstimpfle 5mo agoTBF that is the same as saying "signed overflow is UB".
- kzrdude 5mo agoyes but it is a 'picture' that makes you think about it in a different way.