Hacker News new | ask | show | jobs
by frabert 556 days ago
AFAIK, something having undefined behavior in the spec does not prevent an implementation- (platform-)specific behavior being defined.

As to your point about checks being erased, that generally happens when the checks happen too late (according to the compiler), or in a wrong way. For example, checking that `src` is not NULL _after_ memcpy(sec, dst, 0) is called. Or, checking for overflow by doing `if(x+y<0) ...` when x and y are nonnegative signed ints.