https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88248
kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |janus at gcc dot gnu.org, | |kargl at gcc dot gnu.org --- Comment #4 from kargl at gcc dot gnu.org --- (In reply to G. Steinmetz from comment #0) > Branching out via END=, ERR= or EOR= specifier in combination with > CONTINUE is interpreted as a labeled DO loop. Option -std=f2018 > misleadingly flags this with a warning -- (low prio). > > > $ cat z1.f90 > program p > do > rewind (1, err=99) > end do > 99 continue > end > > > $ cat z2.f90 > program p > character(3) :: c = 'abc' > integer :: k > do k = 1, 10 > open (k, err=99) > close (k, err=99) > backspace (k, err=99) > endfile (k, err=99) > rewind (k, err=99) > flush (k, err=99) > inquire (k, err=99) > read (k, '(a)', end=97) c > read (k, '(a)', eor=98, advance='no') c > read (k, '(a)', err=99) c > write (k, '(a)', err=99) c > wait (k, end=97) > wait (k, eor=98) > wait (k, err=99) > end do > 97 continue > 98 continue > 99 continue > end > > > $ gfortran-9-20181125 -c z1.f90 -std=f2008 > $ > $ gfortran-9-20181125 -c z1.f90 -std=f2018 > z1.f90:5:2: > > 5 | 99 continue > | 1 > Warning: Fortran 2018 obsolescent feature: Labeled DO statement at (1) The warning was added by Janus in r260705. I'll need to look deeper, but I don't think there is an easy way to distinguish between a labeled statement used as do-loop terminator and a ordinary labeled statement.