How can a stack underflow happen in C++?

Viewed 18576

What is a simple example in C++ that causes a stack underflow in the case of invoking and returning from method calls?

I am familiar with the calling convention, i.e thiscall, stdcall and the cdecl and way they would clean the stack. Wouldn't a stack underflow automatically be taken care of by the code generated by the compiler?

What are the situations that can get me into trouble with stack underflow?

4 Answers
Related