module usage and interfaces, bug?

Andrea Ferretti ferretti.andrea@unimore.it
Mon Jan 15 19:10:00 GMT 2007


Dear gfortran developers, 

gfortran seems not able to compile the following chain files, which I 
think should be compliant with the standard (at least as far as I know). 
Thanks in advance for the help.

Best Regards
Andrea

----------------------------------------------

Here follows the detail:

sub.f90       a simple fortran subroutine (eg "hello_x") 
interf.f90    it is a module, containing the explicit interface of
              the routine defined in sub.f90
              (the interface is named "hello", the module 
               "interf_module")

global_interf.f90   a module using "interf_module" contained in interf.f90
              (and therefore making available the interface "hello" )

main.f90      uses the global_module

the compilation stops with a failure when compiling main.f90
giving the error:

Name 'hello' at (1) is an ambiguous reference to 'hello' from module 
'interf_module'

it seems the problems is the double nested level in the USE 
hierarchy for the "hello" name.
A single level works fine.

--------------------------------------------------------------

A simple example showing the problem can be found at:

http://xserv.fisica.unimo.it:16080/~ferretti/TEMP/

open the gzipped tar-ball, enter the directory "example"
and type "make all", the only system requirement is gfortran to be in the 
exec path

--------------------------------------------------------------
here are the details of the gfortran version I used

Using built-in specs.
Target: i386-pc-linux-gnu
Configured with: /home/fxcoudert/gfortran_nightbuild/trunk/configure 
--prefix=/home/fxcoudert/gfortran_nightbuild/irun-20070111 
--enable-languages=c,fortran --host=i386-pc-linux-gnu 
--with-gmp=/home/fxcoudert/gfortran_nightbuild/software
Thread model: posix
gcc version 4.3.0 20070111 (experimental) 

--------------------------------------------------------------

-- 
Andrea Ferretti
National Research Center S3, CNR-INFM  ( http://s3.infm.it )
Dipartimento di Fisica, Universita' di Modena e Reggio Emilia
Via Campi 213/A I-41100 Modena, Italy
Tel:     +39 059 2055301      Fax:     +39 059 374794
Skype:   andrea_ferretti
URL:     http://www.nanoscience.unimo.it

Please, if possible, don't send me MS Word or PowerPoint attachments
Why? See:  http://www.gnu.org/philosophy/no-word-attachments.html



More information about the Fortran mailing list