This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320F28377S: Warning -Indirect calls in stack usage (view window of ccs)

Part Number: TMS320F28377S

Tool/software: Code Composer Studio

Hello,

I am using an array of a function pointer to implement a state machine. There is no error or warning when I compile the code. But during debugging, when I check the stack usage then there us a warning sign with message "indirect call".

So why it appears only in stack usage window??

can it create any problem??  

  • The stack usage view can detect when a function calls other functions indirectly.  But it cannot work out exactly which functions are called indirectly.  This means it cannot complete the call graph, thus it cannot compute the amount of memory required for the stack.  When this happens, this diagnostic is issued ...

    sam kh said:
    a warning sign with message "indirect call".

    sam kh said:
    can it create any problem??  

    I've described the only problem.  To some, this is a big deal.  To others, this is nothing.

    To avoid the warning, use #pragma CALLS to tell the compiler which functions are called indirectly.  For more details, search the C2000 compiler manual.

    Thanks and regards,

    -George

  • I put this in my code as per given syntax but till this warning is coming

    My code structure is like this...

    void fun1(void)

    {
    printf("Inside the fun1\n");
    }

    void fun2(void)
    {
    printf("Inside the fun2\n");
    }

    void fun3(void)
    {
    printf("Inside the fun3\n");
    }

    void fun4(void)
    {
    printf("Inside the fun4\n");
    }

    void (*display_fsm_ptr[2][2])(void)={
                                                                 {
                                                                    fun1,
                                                                    fun2,
                                                                 },
                                                                 {
                                                                    fun3,
                                                                    fun4
                                                                 }
                                                           };

    #pragma CALLS(calling_fun,fun1,fun2, fun3,fun4)

    int calling_fun()
    {

    int loop1=0,loop2=0;

    (*display_fsm_ptr[loop1][loop2)

    loop1++;

    loop2++;

    if(loop1>1)loop1=0;

    if(loop2>1)loop1=0;

    return 0;

    }

     

     

     

     

      

  • I can reproduce the behavior you describe.  This appears to be a problem in CCS.  I filed the entry CCSIDE-3690 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George