On 4/5/24 05:14, Nicola Vetrini wrote:
Refactor the switch so that a violation of MISRA C Rule 16.2 is resolved (A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement). Note that the switch clause ending with the pseudo keyword "fallthrough" is an allowed exception to Rule 16.3.
To give you a quick response, on cursory review, I do not believe the two are equivalent. I have never been a fan of the Duff's device in use here, as it makes reasoning about all the variations difficult. I unrolled all of this once before, and I recall it being a bit more intricate than this.
v/r, dps