Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
kzrdude
· 6mo ago · 0 comments
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.
Comments
[–]
CodeArtisan
6mo ago
C23 removed the whole stuff about indeterminate value and trap representation. Underflow/overflow being silent or not is implementation defined.
[–]
saagarjha
6mo ago
Signed overflow is just undefined.
[–]
jstimpfle
6mo ago
TBF that is the same as saying "signed overflow is UB".
[–]
kzrdude
OP
6mo ago
yes but it is a 'picture' that makes you think about it in a different way.