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.

MISRA warning (MISRA-C:2004 17.6/R) Misreported

MISRA warning (MISRA-C:2004 17.6/R) The address of an object with automatic storage shall not be assigned to another object that may persist after the first object has ceased to exist

typedef void (*FuncPtr)(void); 
FuncPtr moduleFuncPtr;
static void test(const FuncPtr myFuncPtr)
{
    moduleFuncPtr = myFuncPtr; /* You can’t tell whether myFuncPtr is the address of an object with automatic storage – in this case it is a function pointer so isn’t! */
}

 This method is typically used to store an array of function pointers. You can only tell when the address of an object with automatic storage is  being used when you take the address of it. The example in the MISRA standard is:

int8_t *foobar(void)
{
    int8_t local auto;
    return &local_auto;  /* You can only tell whether this is an automatic variable when taking the address */
}

This problem has already been reported to TI but not via forum. I raise it here as it is not visible in the SDOWP.

Regards, Tony.