Bug 45426 - Fixed-form: END may not be continued
Summary: Fixed-form: END may not be continued
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2010-08-27 10:10 UTC by Tobias Burnus
Modified: 2021-12-18 02:24 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2021-12-17 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2010-08-27 10:10:00 UTC
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.
Comment 1 Tobias Burnus 2010-08-27 10:11:02 UTC
I learned about this restriction at
 http://groups.google.com/group/comp.lang.fortran/msg/94c45e3d727f49fc
Comment 2 Dominique d'Humieres 2013-12-29 12:59:11 UTC
Still present at r206227.