This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
problem with duplicate USE, ONLY of procedure in INTERFACE
- From: Vivek Rao <vivekrao4 at yahoo dot com>
- To: fortran at gcc dot gnu dot org
- Date: Sun, 4 Jun 2006 16:27:20 -0700 (PDT)
- Subject: problem with duplicate USE, ONLY of procedure in INTERFACE
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=W9QBTbMb4vHwwoyegpN69nS1RAjF8I7NE3NSjiJmu5zbKKIzudNTBkMHqyHLW12mYAefWbsHy1x8d76hifN/JP4pHTzpH+q8uHmKmQOcStnIdwWmSiHq1XGMdRlvGGcIRu4qrPL/3BiU8vuv2HYaWzmEKtKETo4cPoWJn9uD3DY= ;
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