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]

problem with duplicate USE, ONLY of procedure in INTERFACE


For the program

module foo_mod
implicit none
interface twice
   module procedure twice_real
end interface twice
contains
real function twice_real(x)
real :: x
twice_real = 2*x
end function twice_real
end module foo_mod

program xfoo
use foo_mod, only: twice,twice
implicit none
print*,twice(2.3)
end program xfoo

the i386-pc-mingw32 gcc version 4.2.0 20060531
(experimental) of gfortran on Windows XP says

 In file xduplicate_use.f90:14

use foo_mod, only: twice,twice
                        1
Error: Symbol 'twice' referenced at (1) not found in
module 'foo_mod'

In the thread "USE, ONLY question" in
comp.lang.fortran, most people thought that repetition
in a USE, ONLY statement was standard-conforming.

If "twice" is replaced with "twice_real" in program
xfoo, it compiles and runs, giving the expected
output.

Vivek Rao


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