4 ms·
It won't run out of stack space with a high enough optimization level so that it uses tail recursion. https://en.wikipedia.org/wiki/Tail_call https://en.wikiped
by sn 7y ago
It won't run out of stack space with a high enough optimization level so that it uses tail recursion. https://en.wikipedia.org/wiki/Tail_call https://en.wikipedia.org/wiki/Tail_call
You can try this yourself by compiling:
#include <stdio.h>
int i = 0;
int x() {--i && x(printf("x"));}
int main() {x();}
using gcc with and without '-02'.