I am getting the following MISRA(10.1) warning: Implicit conversion of the expression of underlying type'unsigned char' to the type 'signed int' that is not a wider integer type of the same signedness.
The code is as below:
#define ETH_BUFF_NOTUSED ((uint8)0U)
typedef struct Eth_BuffTableType
{
uint8* Eth_BuffPtr; /* Pointer to the Transmit Buffer*/uint8 Eth_BuffStatus; /* Buffer status free or used */uint8 Eth_StTxCnfn; /* Tx confirmation requested */uint8 Eth_FrameTxReq; /* Request for frame transmission */
}Eth_BuffTableType;
static Eth_BuffTableType *Eth_TxBuffTablePtr;
uint8 TempVar;
(Eth_TxBuffTablePtr + TempVar)->Eth_BuffStatus = ETH_BUFF_NOTUSED;
Question: Why the pointer 'Eth_TxBuffTablePtr' is considered as a 'signed_int'.? Is there any option to make pointer to structures as unsigned while running MISRA checks?
Best Answer