This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to solove warning recursive call to a constant

I have following codes:

void fun1(unsigned char *msg);

void fun2()
{
fun1("ssss");
}
void fun3()
{
}
code void (*func_array[])()={fun2, fun3};

void fun1( unsigned char *msg)
{
(*func_array[1])();
}

void main()
{
(*fun_array[0])();
}

when compiling, i got the following message
*** WARNING L13: RECURSIVE CALL TO SEGMENT
SEGMENT: ?CO?HELLO

Could you please tell me how to solve it? Thanks a lot!

Parents
  • Dan: "... codify the function pointer array at the cost of an additional pushed return address."

    Drew: "It's perhaps worth noting that a switch statement such as the one Dan posted generally compiles into a jump table anyway."

    And when it compiles into a jump table, it does not cost an additional pushed return address.

Reply
  • Dan: "... codify the function pointer array at the cost of an additional pushed return address."

    Drew: "It's perhaps worth noting that a switch statement such as the one Dan posted generally compiles into a jump table anyway."

    And when it compiles into a jump table, it does not cost an additional pushed return address.

Children
No data