Hacker Newsnew | past | comments | ask | show | jobs | submit | rallyrascal's commentslogin

If it's well defined you can actually write simple code to check for overflows (like check if the sum or product is less than the inputs) and it wont get deleted by the compiler.


Consider using the simpler code in your standard library to do this operation instead of the less scrutable version you've described here.


How would it break existing implementations?

Having accessing uninitialized memory be UB is just insane, there's only two possible sane implementations - potential trap for caps based systems (or for a static analyzer) or you get a pseudo random value i.e 'whatever happened to be there'. So just make it implementation defined.


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

Search: