COR070 missing-default-case
warning enabled by defaultA select case construct has no case default.
Why
When no case matches, a select case without case default does nothing, silently. A value that was not foreseen (a new option, a corrupted input) then flows on unhandled. Add case default, even if only to stop with an error that names the unexpected value.
Reported
fortran
select case (scheme)
case ('weno5')
call weno5(q)
case ('weno7')
call weno7(q)
end selectPreferred
fortran
select case (scheme)
case ('weno5')
call weno5(q)
case ('weno7')
call weno7(q)
case default
error stop 'unknown scheme: '//scheme
end selectSuppressing
For one occurrence, with the reason on the same line (or alone on the line before the statement):
fortran
! fobis: ignore[COR070] <why this occurrence is fine>For the whole project, ignore = COR070 in the fobos [lint] section.
Equivalent
Fortitude rule C011 (see Lint Rules).