In C, what will happens to a thread’s execution stack if a function does not return?
void funcB() __attribute__ ((noreturn));
int funcA (...)
{
// do stuff
funcB();
// do more stuff
}
An example of this situation is, says, funcA is the kernel function that creates a new thread and funcB is kernel code that switches the new thread to user mode and let it run.
Thank you.
Have you seen this? http://gcc.gnu.org/onlinedocs/gcc-4.3.2//gcc/Function-Attributes.html
As it says in the section about
noreturn:I assume this means that there is no guarantee that, for example, the stack pointer (or other stack frame elements) will be restored after the
noreturnfunction finishes.