logoalt Hacker News

hathawsh02/20/20251 replyview on HN

It does change the semantics if n is negative or large enough to cause an overflow. The challenge for the compiler is to somehow prove that neither of those things can happen.


Replies

kryptiskt02/20/2025

It doesn't have to prove absence of overflow since that is undefined behavior in C and thus modern compilers assume it can never happen.

show 1 reply