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

What if you write code that doesn't wrap but you don't want the exception or any kind of check either?

That's the whole point of UB. Let the compiler optimize by assuming your integers are in range. I get that it doesn't matter in a language like C#/Java (they are so slow additional checks don't register) but in C throwing has costs and code that wraps would require additional logic on some platforms.

One way or another if you want C to "throw" (trap) you can get that by using compiler flags.




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

Search: