Hi, In our project we are using function pointers. After compiling the project, we got "RECURSIVE CALL TO SEGMENT" warning. By selecting OVERLAY (sfname ! *)in BL51, that warnings was removed. If we add function name in OVERLAY, will it allocate diffrent memory for local variables and function argumants?. How it is diffrent from by difining same function as rentrant function ?. Thanks in advance..
Thanks Jay Daniel. So, Which are the functions are being called indirectly(through function pointers)are should be defined using OVERLAY directive. we need not to define it as reentarnt. Am I missed any thing, please comment on this... Thanks Rajesh
Rajesh, I believe the general idea is that you can do one of two things. The first is to specify for the compiler which modules it should just skip doing overlaying for altogether. The other method is to take a look at your code and use the OVERLAY directive to help the compiler finish the call-tree that it would be otherwise unable to generate. As for the specifics, you'll have to look in the manual. If I could suggest an alternative, however: Could you simply use another function as a "dispatch" function that takes a parameter. For instance, you're using function pointers so that you could do something like:
functable[i]()
void dispatcher(unsigned char i) { switch(i) { case 1: a(); break; case 2: b(); break; } }