News for hackers. Stuff that matters.
Re:Re: C as used/implemented in practice by Joky on Monday July 13, 2015 @09:11PM (#9882260)
I believe it is not the original reason: most UB are about funky HW. For instance for the non-wrap signed int it can be explained because C does not assume you have 2-complement hardware.
Re:Re: C as used/implemented in practice by jcranmer on Tuesday July 14, 2015 @12:37AM (#9882916)
More specifically, some early hardware would trap on signed overflow. A lot of undefined behavior in C actually comes from "some machine would cause a trap", and C predates the invention of precise trapping in out-of-order processors. The possibility of traps is generally the difference between undefined behavior or unspecified/implementation-defined behavior.