[Bug fortran/36325] New: specific or generic INTERFACE implies the EXTERNAL attribute

jaydub66 at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun May 25 13:36:00 GMT 2008

I think the following code is invalid:

  subroutine foo
  end subroutine
end interface
external foo

Because the INTERFACE statement already specifies the EXTERNAL attribute, which
is thus specified twice.

This code *is* actually rejected (as of rev. 135859), but the error message is
completely wrong:

external :: foo
Error: EXTERNAL attribute conflicts with SUBROUTINE attribute at (1)

(which it does *not* for this case)

Quoting the Fortran 2003 standard (section

"The EXTERNAL attribute specifies that an entity is an external procedure,
dummy procedure, procedure pointer, or block data subprogram. This attribute
may also be specified by an EXTERNAL statement (, a
procedure-declaration-stmt ( or an interface body that is not in an
abstract interface block ("

And further on in section

"An interface body in a generic or specific interface block specifies the
EXTERNAL attribute and an explicit specific interface for an external
procedure or a dummy procedure. If the name of the declared procedure is that
of a dummy argument in the subprogram containing the interface body, the
procedure is a dummy procedure; otherwise, it is an external procedure."

           Summary: specific or generic INTERFACE implies the EXTERNAL
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jaydub66 at gmail dot com


More information about the Gcc-bugs mailing list