logoalt Hacker News

pinoy42002/20/20251 replyview on HN

Amazing it can do that. How does it work?

That definitely does seem to change its semantics to me. I am not a c expert but this surely has problems the previous one doesn’t?


Replies

hathawsh02/20/2025

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.

show 1 reply