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 10.1 false positive?

Hi,

I'm using  CCS Version: 6.0.1.00040 with the TI v5.1.10 C/C++ Compiler. When the MISRA checks are enabled, i am seeing the MISRA warning 10.1/R for the following code.

I can't work out why it is complaining, i've tried every type of casting i can think of to no avail.

Is this a bug in the MISRA checker? Or is there a real issue?

Many thanks,

James

/* Function prototype and declaration */
void test_func(uint32_t *ptr);

void test_func(uint32_t *ptr)
{
    *ptr = 0u;
}

/* Using the function */
uint32_t fail = 0u;

test_func(&fail);

/* The above function call has the following warning: #1393-D (MISRA-C:2004 10.1/R) 
* The value of an expression of integer type shall not be implicitly converted to a different
* underlying type if the expression is not constant and is a function argument
*/






  • Thank you for reporting this issue.  I think it is a problem in the compiler.  I filed SDSCM00051702 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