Tool/software: TI C/C++ Compiler
I am using MISRA-C option with the latest version of the compiler TI V17.3.0.STS. I have also tried earlier versions of the compiler.
I have a function,
Insert_Checksum_Buffer( &UART_TXD_Buffer[0] );
which the compiler reports
Description Resource Path Location Type
#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 Frames.c /MAP/source MAP line 27 C/C++ Problem
where
uint8_t UART_TXD_Buffer[64];
and function definition is
/*--------------------------------------------------------*/
void Insert_Checksum_Buffer(uint8_t *ptr_address)
{
..
}
so i cast as follows,
Insert_Checksum_Buffer( (uint8_t *)(&UART_TXD_Buffer[0]) );
and now i get the warning message,
Description Resource Path Location Type
#1395-D (MISRA-C:2004 10.3/R) The value of a complex expression of integer type shall only be cast to a type of the same signedness that is no wider than the underlying type of the expression Frames.c /MAP/source MAP line 236 C/C++ Problem
How do I code this function without generating any MISRA-C warnings?
I have literally 1000's of these functions in my code that needs to be resolved.
thanks in advance
Rob