program lau_error ! ! most compilers seem to permit this excremental bit of coding ! some give warnings that this is bad stuff ! gfortran barfs on it ! ! In file lau_error.f90:12 ! ! 10 continue ! 1 ! In file lau_error.f90:9 ! ! if ( i > 1 ) goto 10 ! 2 !Error: Label at (1) is not in the same block as the GOTO statement at (2) ! Paul Thomas 18/11/04 ! integer :: i , N = 2 do i = 1 , N print * , 'i = ', i if ( i > 1 ) goto 10 !!jump into the if block *sigh* if ( i > 0 ) then print * , 'first statement in if block' 10 continue print * , 'continue within if block' end if print * , 'out of if block' end do stop end program lau_error
-- Summary: Jumping into blocks gives error rather than warning Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: paul dot richard dot thomas at cea dot fr CC: gcc-bugs at gcc dot gnu dot org,paulthomas2 at wanadoo dot fr http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18540