Skip to content

COR072 missing-rank-default ​

warning opt-in

A select rank construct has no rank default.

Why ​

An assumed-rank dummy can have any rank up to 15: a select rank listing only some ranks silently does nothing for the others. Add rank default that reports the unsupported rank.

Reported ​

fortran
select rank (a)
rank (1)
  call apply_1d(a)
end select

Preferred ​

fortran
select rank (a)
rank (1)
  call apply_1d(a)
rank default
  error stop 'unsupported rank'
end select

Suppressing ​

For one occurrence, with the reason on the same line (or alone on the line before the statement):

fortran
! fobis: ignore[COR072] <why this occurrence is fine>

For the whole project, ignore = COR072 in the fobos [lint] section.