News for hackers. Stuff that matters.
Re:Everything in C is undefined behavior by kzrdude on Wednesday May 20, 2026 @06:29AM (#48205585)
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.
Re:Everything in C is undefined behavior by CodeArtisan on Wednesday May 20, 2026 @07:03AM (#48205835)
C23 removed the whole stuff about indeterminate value and trap representation. Underflow/overflow being silent or not is implementation defined.
Re:Everything in C is undefined behavior by saagarjha on Wednesday May 20, 2026 @07:19AM (#48205958)
Signed overflow is just undefined.
Re:Everything in C is undefined behavior by jstimpfle on Thursday May 21, 2026 @02:49AM (#48218813)
TBF that is the same as saying "signed overflow is UB".
Re:Everything in C is undefined behavior by kzrdude on Thursday May 21, 2026 @02:57AM (#48218865)
yes but it is a 'picture' that makes you think about it in a different way.