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.

CCS, MISRA 12.2, MSP430 Warning



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.

  • Thank you for submitting a test case.  I can reproduce that same diagnostic.  The compiler appears to be in error.  I filed SDSCM00052304 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