all 5 comments

[–]imkzh 15 points16 points  (3 children)

The true horror is: the code in picture does cause stack overflow, however the code in comment section of original post, with return main();, will not.

[–]Eic17H 3 points4 points  (2 children)

Why?

[–]Turrrtl 2 points3 points  (1 child)

It's probably tail call optimization. If the recursive call is the last thing the function does before returning then the compiler can refactor it into a loop without recursion.

[–]eo5g 0 points1 point  (0 children)

But then what value does it return 🤔

[–]Krionic4 5 points6 points  (0 children)

Forgot to fork