2 Specific MISRA C:2012 Deviations
- Member DIAG_SRAM_Checkerboard (uint16_t startAddress, uint8_t length, uint16_t bufferAddress)
-
Advisory: misra-c2012-15.5
Justification: The function should return as soon as a Fault is detected. Avoiding the use of multiple return statements would require having multiple additional checks which would add overhead, diminish code readability and would require defaulting the test result to DIAG_PASS. The latter is deemed less safe than only returning DIAG_PASS when all sections have been tested with no Fault detected. Since there is no functional termination code in this function, it cannot accidentally be omitted and since the function does not have any persistent side effects, there is no issue in discerning which side effects have been applied when the function is executed/exits and thus the deviation is deemed safe.