This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Possible problem with optional procedure argument


Hello,

  I was unable to find out if this code is standart conforming, or not

module m
contains
  subroutine test(proc)

    procedure(interf), optional :: proc

    abstract interface
      subroutine  interf
      end subroutine
    end interface

  end subroutine

end module

as it is it fails to compile with gfotran 4.9

gfortran-4.9 opt_proc.f90
opt_proc.f90:3.22:

  subroutine test(proc)
                      1
Error: Interface 'interf' at (1) must be explicit
opt_proc.f90:3.22:

  subroutine test(proc)
                      1
Error: Interface 'interf' at (1) must be explicit

It compiles if the interface is placed before the dummy argument declaration.

What is weird is it also compiles as an external subroutine, if I
remove the module.

  Best regards,

    Vladimir


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]