Hacker News new | past | comments | ask | show | jobs | submit login

>If you understand how computers work it is extremely reliable bar none.

On my processor, INT64_MAX + 1 will be INT64_MIN, a negative value. But the compiler is free to turn

  for (int64_t i = 1; i > 0; i++) {
  	f(i);
  }
into an infinite loop. Understanding how the computer works without reading about undefined behavior will make you fall into these kinds of traps.



missing overflow guards is just one of the big disappointments in c, if you have experience with asm for any popular processor atm.


Wasn't part of the scope of the language. It's a doble edged sword, but I could see that being a good thing too. If you want raw speed, and know what you're doing, it could be OK not to have overflow guards.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: