Indeed. The invalid optimization clang is making is assuming malloc doesn't fail. Unless GCC also does that, GCC is ok.
I label SO as UB because the standard leaves it undefined by omission of any attempt to resolve contradictions around it.
-
-
Well, the standard doesn't mention stack at all. One way to look at it is that, hence, there are no restrictions on\
-
a program related to stack. Thus, all implementation using stack are not conforming.
-
But as you mentioned memory is limited in practice, stack or not. And there are similar problems with static vars.
-
You can ignore the word "stack". Problem is that the C std ignores inherent finitude of automatic storage.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.