logoalt Hacker News

jstimpfletoday at 1:53 PM2 repliesview on HN

If it is defined as an error, but the compiled build will continue to run with the value wrapped around, I would say that's indistinguishable from UB.


Replies

SAI_Peregrinustoday at 5:20 PM

It's indistinguishable from unspecified behavior, not from undefined behavior. Unspecified behavior has to pick from a finite list of allowed behaviors. Undefined behavior can do anything.

show 1 reply
12_throw_awaytoday at 3:19 PM

No. An integer getting deterministically set to an unintended value is a bug. A bug is not the same thing as UB. (Even if it were non-deterministic, it would still not be anything like UB.) It's not the same ballpark, not even the same sport.

show 1 reply