rfc: multiple decls for functions
Daniel Franke
franke.daniel@gmail.com
Fri Dec 19 21:47:00 GMT 2008
On Friday 19 December 2008 21:32:54 Steve Kargl wrote:
> > Generally, this seems to be straight forward. However, does this work for
> > any combination of functions/subroutines, if external, if contained, if
> > in modules, if ... any corner-cases that spring to mind? Maybe [3]?
>
> You may need to include renaming for procedures in a module, ie,
>
> use modu, only : wave => my_sine_function
This has been taken care of in the resolution stage. When preparing the decls,
we already know which function to call:
$> cat call3.f90
MODULE m
CONTAINS
SUBROUTINE f()
END SUBROUTINE
END MODULE
SUBROUTINE f
END SUBROUTINE
PROGRAM p
USE m, ONLY: g => f
CALL f()
CALL g() ! <-- __m_MOD_f
END PROGRAM
$> gfortran-svn -g -Wall call3.f90
--> building decl for function/subroutine: __m_MOD_f
--> building decl for function/subroutine: f_
--> building decl for function/subroutine: MAIN__
--> building decl for called function/subroutine: f_
--> building decl for called function/subroutine: __m_MOD_f
More information about the Fortran
mailing list