Recursive main() - why does it segfault?

Posted by user299831 on Stack Overflow See other posts from Stack Overflow or by user299831
Published on 2010-03-23T11:24:48Z Indexed on 2010/03/23 11:33 UTC
Read the original article Hit count: 207

Filed under:
|

Why does the following programm segfault?

int main() { main(); }

Even though it is a recursion that does not end and therefore invalid by definition, I don't see why it segfaults (gcc 4.4.3 and clang 1.5 (trunk)).

© Stack Overflow or respective owner

Related posts about c

    Related posts about segmentation-fault