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

I'm not sure I understand you. What is the difference between undefined and unspecified behavior?

If it was decided that an overflow would generate an error, than it was a design decision to trap errors at that level. The program could crash so that everybody knows something is wrong.

If it was decided that an overflow just would overflow, than it sounds like a refusal to trap the error. The program could continue in an unexpected state.

Maybe it's better to crash the program so you know something is wrong.




> I'm not sure I understand you. What is the difference between undefined and unspecified behavior?

They explained in the very next sentence: "e.g. it's not specified what result an integer overflow gives, but the rest of the program must continue normally".

(In the C standard, "unspecified" is an explicit marker for things where a compiler must document its choice of semantics.)




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: