Re:The Dark Side of C++ [pdf]
by kinghajj on Monday August 02, 2010 @12:24PM
(#1568053)
I don't see the problem. The nodes of the list are freed from beginning to end, and then "Done" is printed. What's supposed to be wrong here?
[ Parent
| on HN ]
Stack overflow for large n.
Ah, I didn't consider that. A decent optimizing compiler should be able to remove all the tail calls (G++ did this with your code and -O2), so this shouldn't be a problem in practice, except maybe for debugging.