Usually we just say something like "therefore, the behaviour is undefined". The problem with claiming that there's "nothing there" is that the memory might still contain what was there, and then...
Type: Posts; User: laserlight
Usually we just say something like "therefore, the behaviour is undefined". The problem with claiming that there's "nothing there" is that the memory might still contain what was there, and then...
Refer to post #2:
Refer to post #5:
Refer to post #8:
And refer to std10093's post #15, with the caveat that the claim that "as a result, there is nothing there. So, sMain points to nothing"...
Yes, but your example program has #include <stdio.h>. In a freestanding environment, the standard library need not provide <stdio.h>.
EDIT:
But really, there's no point arguing this. Unless you...
Yeah, the bug has to do with returning a pointer to a local variable. It is not a bug in gcc. Personally, I would be more cautious before declaring that I have found a bug in a reputable compiler....