OBS010 arithmetic-if
warning enabled by defaultAn arithmetic if (x) l1, l2, l3.
Why
The arithmetic IF branches on the sign of an expression to one of three labels. It was deleted in Fortran 2018. Use a block if / select case.
Reported
fortran
if (x) 10, 20, 30Preferred
fortran
if (x < 0) then
...
else if (x == 0) then
...
end ifSuppressing
For one occurrence, with the reason on the same line (or alone on the line before the statement):
fortran
! fobis: ignore[OBS010] <why this occurrence is fine>For the whole project, ignore = OBS010 in the fobos [lint] section.
Equivalent
Fortitude rule OB081 (see Lint Rules).