logoalt Hacker News

marcosdumaytoday at 4:43 PM1 replyview on HN

Except that UB doesn't mean that. UB means "the developer must never write this".


Replies

munch117today at 5:25 PM

Both are wrong. It means "this standard does not constrain the behaviour of code that does this".

It's entirely legal for implementations to have predictable behaviour, documented or not, for code that is undefined by the standard. In their quest for maxxing benchmark performance they generally choose not to, but there's really nothing in any standard that stops you from making an implementation that prioritises safety.

show 1 reply