Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm just trying to draw the line between U.B. that is guaranteed to happen at runtime (at which point the compiler is, technically speaking, not even obligated to provide you with a binary to run), and U.B. that will only happen if that particular code is executed, but doesn't trigger if that branch is omitted. It's probably overly pedantic, but given what modern optimizing compilers do, I'm in the "better safe than sorry" camp.

You definitely have a point regarding compiler just ripping that code out. I guess the proper approach would be to do something like if(argv[0][0]), or test a volatile variable.



But in this case, the U.B. is guaranteed to happen at runtime, even with the proper return type. There are no branches involved here...


Yes, you're right. I was thinking aloud about how it could be made conforming, in principle.


Gotcha.




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

Search: