Fortran 2008 (and earlier) have: "3.3.3.5 Fixed form statements" "The program unit END statement shall not be continued. A statement whose initial line appears to be a program unit END statement shall not be continued."
(That applies to all END: "A program unit is a main program, an external subprogram, a module, a submodule, or a block data program unit.") gfortran currently does not diagnose this: a) EXAMPLE 1: initial line appears to be a program unit END statement ------------ integer :: ender end +er = 5 print *, ender end b) EXAMPLE 2: END statement which is continued ------------ subroutine test end * subroutine test Expected: With -std=f2008 / -pedantic, the continuation line is rejected / being warned for - with -std=gnu/legacy it is accepted. Intel's ifort prints with -stand f03: test.f(2): error #5269: Operator END of program unit cannot be continued. end ------^ Though I do not like Intel's wording. -- Summary: Fixed-form: END may not be continued Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45426