Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
kzrdude
5d ago
0 comments
Share
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.
0 comments
default
newest
oldest
jstimpfle
4d ago
TBF that is the same as saying "signed overflow is UB".
kzrdude
OP
4d ago
yes but it is a 'picture' that makes you think about it in a different way.
CodeArtisan
5d ago
C23 removed the whole stuff about indeterminate value and trap representation. Underflow/overflow being silent or not is implementation defined.
saagarjha
5d ago
Signed overflow is just undefined.
j
/
k
navigate · click thread line to collapse