3 ms·
> Undefined behaviour being weird and having bizarre implications is not a feature of C. How so? It is behavior left undefined in the C standard. > It is a fe
by cycomanic 4y ago
> Undefined behaviour being weird and having bizarre implications is not a feature of C.
How so? It is behavior left undefined in the C standard.
> It is a feature introduced by compiler writers who prize esoteric optimisations more than simplicity.
It's not the compiler writers who left the behaviour undefined, but the standard writers. If it was so clear what should be done (so all compiler writers should do it in one way) then why did they not define it?
> And it is not forbidden by the standard, though discouraged.
What do you mean it's not forbidden in the standard, it's undefined in the standard hence the name. Because of this you really should not rely on it, because the behavior could change.