Hi,
I am getting a MISRA warning on code. Could it be a bug in the tools?
unsigned char Odear[] = {0x00U,0x01U,0x02U,0x03U,0x04U,0x05U};
void AFunction(uint8_t AAa, uint8_t BBb);
volatile uint8_t PortF;
int16_t main(void)
{
AFunction(Odear[4], Odear[5]);
}
void AFunction(uint8_t AAa, uint8_t BBb)
{
PortF = AAa + BBb;
}
The call to AFunction results in the following warning:
#1487-D (MISRA-C:2004 12.2/R) The value of an expression shall be the same under any order of evaluation that the
standard permits.
If I change one of the passed parameters to a literal constant the warning goes away.
Thanks, Nick.