Even after following MISRA Guidelines and Model adviser ran with zero errors POLYSPACE is throwing MISRA C 2012 violations
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen

2 Kommentare
Walter Roberson
am 17 Jan. 2025
u8_retriesCounter hints that you are working with an 8 bit unsigned value. In C when you add 1 to the maximum 8 bit unsigned value, the value overflows back to 0 rather than saturating.
I am not currently convinced that qY is anything other than 8 bit unsigned; if so then it cannot be greater than 255.
Walter Roberson
am 21 Jan. 2025
Better code would be
if SMIT_EHL_LITE_b_DW.u8_retriesCounter >= 254U
qy = 255U;
else
qy = SMIT_EHL_LITE_b_DW.u8_retriesCounter + 1U;
end
Antworten (0)
Siehe auch
Kategorien
Mehr zu MISRA C:2012 Directives and Rules finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!