RIOT icon indicating copy to clipboard operation
RIOT copied to clipboard

cpu/native: LPM, should we add a break in switch case?

Open PeterKietzmann opened this issue 11 years ago • 5 comments

Please compare this line. Even if it's an exit call, I wonder if we should add a break; there for the sake of completeness.

PeterKietzmann avatar Jul 07 '15 08:07 PeterKietzmann

@LudwigOrtmann any suggestions?

PeterKietzmann avatar Jul 07 '15 08:07 PeterKietzmann

Wouldn't that just be one unnecessary instruction?

kaspar030 avatar Jul 07 '15 08:07 kaspar030

Maybe yes. But that is what I'd like to figure out. Feel free to close this issue if this is (really) the case

PeterKietzmann avatar Jul 07 '15 08:07 PeterKietzmann

As long as there exists no condition in real_exit() that could make it return, break would be considered "dead code". Code analyzers may give a warning on that sequence.

A-Paul avatar Jul 07 '15 14:07 A-Paul

Ok, then let's close this issue

PeterKietzmann avatar Jul 07 '15 14:07 PeterKietzmann