Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by hathawsh

6 months ago

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.

2 comments

hathawsh

Reply

kryptiskt  6 months ago

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.

  • hathawsh  6 months ago

    Great point.

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities