Earlier quoted context omitted.
> Undefined means : the compiler can omit this case and assume it never happens. That's not the whole picture though. The standard actually says that anything can happen in undefined cases. > However, if any such execution contains an undefined operation, this International Standard places no requirement on the implementation executing that program with that input (not even with regard to operations preceding the fir…
Anything can happen because the compiler will assume it doesn't happen. "Undefined behavior" essentially means, "If you try to do this, you have written a program that is not C, and you should not be handing it to a C compiler expecting it to do anything correctly ." If you were to try to write a program that accurately detected whether the given input is a meaningful C program, you'd have to solve the Halting Proble…
It's just C whose actual behavior is unspecified (and, because the standard is outright perverse, makes the entire program's behavior undefined) by the standard and, if you are especially lucky, explicitly defined by the particular C implementation. But maybe not even then.