Recursion unsafe in C/C++?

05 Mar 2008

One of the guys who is writing CouchDB, wrote up this this interesting note: Recursion unsafe in C/C++. It starts off with this

The question of "why disallow recursion in C++?" came up in a comment to the C++ coding standards for the Joint Strike Fighter.

I was just thinking the same thing. ha!

Comment 2009-01-20 by None

Recursion is also unsafe from a security perspective in C++, as depending how your address space is layed out the stack can overflow into library code. Particulary, if you are going to accept user generated regexes (always dangerous) you need to stay away from PCRE because it is recursion based and possible to generate pathological regexes that will overflow the stack.