2 Specific MISRA C:2012 Deviations
- Global DIAG_SRAM_MarchCMinus (uint16_t startAddress, uint16_t length, uint16_t bufferAddress)
-
Advisory: misra-c2012-15.5
Justification: The function will return as soon as a Fault is detected. Avoiding the use of multiple return statements requires having numerous additional checks which would add overhead, diminish code readability, and would imply 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 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, thus, the deviation is deemed safe.