Jump to content
Sign in to follow this  
rfuchs

Too many nested calls

Recommended Posts

Hello together,

 

I have a Problem by using the c2c++-Compiler.

The following Compiler-Error appears:

 

"too many nested calls"

 

What is the limit of nested function calls?

Is there probably an other problem?

 

bye rf

Share this post


Link to post
Share on other sites
Guest Pavel

The number of nested calls is limited by the target hardware stack that is 8 levels deep. Note that if your code uses const variables, mul/div operations or some buit-in functions they also require 1 call level (complex built-in functions more) so you have only 7 left.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

thanx for your answer.

 

How can I solve this Problem? For my Application i need a depth of up to 15 nested function calls.

 

Is it possible to solve the Problem with inlines?

 

best regards

roland

Share this post


Link to post
Share on other sites
Guest Pavel

8 calls deep stack is a fundamental limitation of PIC/SX architecture and none of the existing compilers can help you here. Even with inline functions if one of them calls another this still may require a call instruction. You need to re-architect your code so that it uses smaller number of nested calls or move to another hardware platform that uses software stack.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...