After my post on undefined behavior in C some people insisted that it’s demonstrably fine, we know what the code will do, and at worst we’ll get a segfault.
they’re labeled UB in the standard (POSIX definition is irrelevant).
No, UB is not required to be undefined: one of its purposes is to provide extension points for implementations. See my earlier quotes from the rationale.
You won’t find this out by reading the standard, but (as well as the rationale) it’s often mentioned in committee papers.
No, UB is not required to be undefined: one of its purposes is to provide extension points for implementations. See my earlier quotes from the rationale.
You won’t find this out by reading the standard, but (as well as the rationale) it’s often mentioned in committee papers.
score 2 · canonical