Silverfrost Forums

Welcome to our forums

FTN95 Error with internal procedure

18 Aug 2005 8:20 #270

The following program, looks quite legal to me, gives error message : duplicate name.

!             Koenig.f95
module M1 

INTEGER, public :: p
public :: AA
private :: BB

CONTAINS 
subroutine AA () 
   p = BB () 
 CONTAINS 
   subroutine AA_1 () 
     integer :: i 
     i = BB () 
   end subroutine AA_1

   function BB( ) result(r)
   integer :: r
     R = 1
   end function BB
end subroutine AA

function BB() result(Q)
  integer :: Q
  Q = 2
end function BB
end module M1

program P1 
  USE M1 
  implicit none
  p = 0 
  call AA () 
  print *, p 
end program P1

! D:\Fortran\Test>ftn95 koenig.f95 /lgo ! [FTN95/Win32 Ver. 4.8.0 Copyright (C) Salford Software Ltd 1993-2005] ! PROCESSING MODULE [<M1> FTN95/Win32 v4.8.0] ! 0012) integer :: i ! WARNING - Variable I has been given a value but never used ! NO ERRORS, 1 WARNING [<AA_1> FTN95/Win32 v4.8.0] ! NO ERRORS [<BB> FTN95/Win32 v4.8.0] ! NO ERRORS [<AA> FTN95/Win32 v4.8.0] ! 0022) function BB() result(Q) ! *** Duplicate sub-program name M1!BB ! 1 ERROR [<BB> FTN95/Win32 v4.8.0] ! NO ERRORS [<M1> FTN95/Win32 v4.8.0] ! NO ERRORS [<P1> FTN95/Win32 v4.8.0] ! *** Compilation failed

JvO

22 Aug 2005 2:37 #275

Yes thank you. This is a bug which I have logged with reference number 2207.

Paul

23 Aug 2005 11:57 #279

This bug has now been fixed

24 Aug 2005 5:19 #281

Now that the bug is fixed, when will the downloadable program be updated ?

[JvO]

write(,)transfer((/778985834,1869504886,1702130543,1785296754 & &,1635205227,1868849518,1819160175 /),(/'x'/)) ; end

24 Aug 2005 5:32 #282

Hopefully sometime during September.

Please login to reply.