By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,305 Members | 1,903 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,305 IT Pros & Developers. It's quick & easy.

does your compiler / lint catch infinite recursion ?

P: n/a
Does anybody know if there are any compilers that warn of infinite
recursion ( a very simple case )

like

void foo( int a )
{
return foo( a );
}

gcc does not seem to and lint does not seem to catch it either.

Aug 22 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
John wrote:
Does anybody know if there are any compilers that warn of infinite
recursion ( a very simple case )

like

void foo( int a )
{
return foo( a );
}

gcc does not seem to and lint does not seem to catch it either.
Visual C++ issues the warning C4717 when compiling this:

void foo(int a)
{
foo(a);
}

int main()
{
foo(42);
}

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Aug 22 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.