miss_hit
miss_hit copied to clipboard
mh_lint: make sure enum coverage is complete
switch/case statements must have a default case (otherwise
) if needed
Motivation: If the case is selected based on an enumerated value and not all enum members are handled, either explicitly or by a default case, compilation of code generated with Matlab Coder will often result in compiler warnings (e.g. enumeration constant X not handled in switch
).
Requires: #149
Making this a style rule is not helpful I think. However in the upcoming linter we'll know if the enum coverage is complete or not; and we can warn about useless otherwise and missing cases in that case.