Skip to content

COR090 missing-exit-or-cycle-label ​

warning enabled by default

An exit or cycle inside a named DO loop does not name the loop.

Why ​

A loop was given a name to make control flow explicit; a bare exit/cycle inside it refers to the innermost loop, which is that loop today but silently changes when an inner loop is added. Write exit name / cycle name.

Reported ​

fortran
cells: do i = 1, n
  if (done(i)) cycle
end do cells

Preferred ​

fortran
cells: do i = 1, n
  if (done(i)) cycle cells
end do cells

Suppressing ​

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

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

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

Equivalent ​

Fortitude rule C141 (see Lint Rules).