Most C/C++ compilers that implement some kind of tail-call optimization (TCO) will refuse to do it for a large number of cases, including some of these:
&
)alloca()
(or a C99-variable-sized array)setjmp()
or exceptionsIt's funny: The same people who worry about stack smashing are the same people who try and recover when malloc()
returns NULL.