This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/23423] New: module routines do not resolve module's interface blocks
- From: "jeffrey dot armstrong at analexcleveland dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Aug 2005 16:45:45 -0000
- Subject: [Bug fortran/23423] New: module routines do not resolve module's interface blocks
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Functions/subroutines in a module are not aware of interfaces declared within
the module. For example, the test case:
! BEGIN test.f90 -----------------------------
module test
implicit none
interface foo
module procedure foo_4
module procedure foo_8
end interface foo
contains
function foo_4(input_num)
implicit none
real(kind=4)::foo_4
real(kind=4)::input_num
foo_4 = input_num*input_num
end function foo_4
function foo_8(input_num)
implicit none
real(kind=8)::foo_8
real(kind=8)::input_num
foo_8 = input_num*input_num
end function foo_8
function bar(input_num)
implicit none
real(kind=8)::bar
real(kind=8)::input_num
bar = foo(input_num)
end function bar
end module test
! END test.f90 -------------------------------
When compiled, gcc returns the following output:
$ gfortran -v -save-temps -c test.f90
Using built-in specs.
Target: i686-pc-cygwin
Configured with: ../gcc-4.0.1/configure --enable-threads=win32 --enable-java-awt=gtk
Thread model: win32
gcc version 4.0.1
/usr/local/libexec/gcc/i686-pc-cygwin/4.0.1/f951.exe test.f90 -quiet -dumpbase
test.f90 -mtune=pentiumpro -auxbase test -version -o test.s
GNU F95 version 4.0.1 (i686-pc-cygwin)
compiled by GNU C version 4.0.1.
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=65446
In file test.f90:35
bar = foo(input_num)
1
Error: Symbol 'foo' at (1) has no IMPLICIT type
Other Fortran compilers (Absoft, DEC/Compaq Visual Fortran) are able to compile
this code.
--
Summary: module routines do not resolve module's interface blocks
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jeffrey dot armstrong at analexcleveland dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-cygwin
GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23423