Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 6-4-5 Is return as last statement of a switch-clause also compliant to this rule?
#5
We write application code for devices used in power plants, substations, etc. which must be 100% MISRA C++ compliant because we (and not our customers) want a high safety on code development.

But we write also code for device communication stacks and for applications running on Windows computers which must not be 100% MISRA C++ compliant, but of course should be also well coded as much as possible. We have defined which MISRA C++ rules are not used in code of software which must not be 100% MISRA C++ according to our own definition because of being counterproductive on developing communication stacks and GUI applications on which also C++11 and C++14 extensions are used not covered by MISRA C++:2008 at all.

There are just a few rules ignored for software which must not be 100% MISRA C++ compliant according to our own definition. One of these ignored rules is rule 6-6-5. But rule 6-4-5 is used as an unintentional fall through is never good in code of any software.

So let us think a rule 6-6-5 would not exist in MISRA C++:2008, would the existence of return as last statement of a switch-clause be compliant for rule 6-4-5?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)