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.

RTOS/PROCESSOR-SDK-AM335X: Unreachable code warning

Part Number: PROCESSOR-SDK-AM335X

Tool/software: TI-RTOS

Here's a new one...

I recieved an "unreachable code" warning... actually two of them.

"package/cfg/app_pea8fnv.c", line 20172: warning: statement is unreachable
"package/cfg/app_pea8fnv.c", line 20353: warning: statement is unreachable

That is coming from the stuff generated by XDC.  Here is one of them:

/* Object__get__S */
xdc_Ptr ti_sysbios_knl_Queue_Object__get__S(xdc_Ptr oa, xdc_Int i)
{
    if (oa) {
        return ((ti_sysbios_knl_Queue_Object__ *)oa) + i;
    }
    if (ti_sysbios_knl_Queue_Object__count__C == 0) {
        return NULL;
    }
    return ((ti_sysbios_knl_Queue_Object__ *)ti_sysbios_knl_Queue_Object__table__C) + i;  <----  HERE
}

The last return is unreachable.  Clearly it the second "if" statement is always true.  Because on line # 7244 we have this

/* Object__count__C */
#pragma DATA_SECTION(ti_sysbios_knl_Queue_Object__count__C, ".const:ti_sysbios_knl_Queue_Object__count__C");
__FAR__ const CT__ti_sysbios_knl_Queue_Object__count ti_sysbios_knl_Queue_Object__count__C = 0;

My config file doesn't have anything about a Queue.  Why is it generating this code, and throwing warning at me?

-CSW