f18 icon indicating copy to clipboard operation
f18 copied to clipboard

Weird warning from extended range unlabeled DO loop

Open klausler opened this issue 5 years ago • 3 comments

do j=1,5
  go to 1
2 continue
end do
go to 3
1 go to 2
3 continue
end

elicits "label '2' is not in scope" as a warning.

klausler avatar Aug 22 '19 17:08 klausler

Are you saying the message needs to be improved?

I believe the warning is technically true. The goto 2 is jumping into a DO construct.

schweitzpgi avatar Aug 22 '19 18:08 schweitzpgi

The warning is distinct from the warning emitted for jumps into labeled DO loops ("branch into loop body from outside", with a pointer to the loop), and confusing because it implies that labels have construct scope, which they don't have.

klausler avatar Aug 22 '19 18:08 klausler

See about improving the error message if this is still around.

sscalpone avatar Dec 11 '19 17:12 sscalpone