In an ideal world, sure, but I know no such intelligent C compiler. Runtime stack checking is supported in debugging mode by some compilers. Normal programs do no stack checking as to my knowledge.