cyclonedds icon indicating copy to clipboard operation
cyclonedds copied to clipboard

Fix part of MISRA rule 16-N.

Open Splinter1984 opened this issue 1 year ago • 0 comments

This addresses rule 16-N.

All switch statements shall be well-formed.

This PR resolve only next violations.

  • "Every switch statement shall have a default label"

Exclude switch throw Enum type.

  • "An unconditional break statement shall terminate every switch-clause"

Exclude cases when we need to "Fall through". And cases when we using goto label; or return value from switch-case (Because otherwise it's dead code!).

The next violation needs to be discussed.

  • "The switch-clause following the default label shall, prior to the terminating break statement, contain either: comment, statement"

Splinter1984 avatar Jul 10 '23 14:07 Splinter1984