This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Possible problem with optional procedure argument
- From: VladimÃr Fuka <vladimir dot fuka at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Date: Fri, 8 Aug 2014 12:38:44 +0200
- Subject: Possible problem with optional procedure argument
- Authentication-results: sourceware.org; auth=none
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