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]

Re: Is this legal?


An update: the following modification looks like a bug to me (a PRIVATE
subroutine accessible from outside its module??) 
Thanks for any clarifications..
 /usr/local/gfortran/bin/gfortran -o trymod trymod.f90 
[sfilippo@euler PSBLAS]$ ./trymod 
 From subroutine (internal) SUB2 called from sub1
 From subroutine (internal) SUB2 called from Main
STOP 0

----------- trymod.f90--------------
module aaa
  private 
  public :: sub1
contains
  subroutine sub1()
    call sub2('sub1')
  end subroutine sub1
  subroutine sub2(str)
    character(len=*), intent(in) :: str
    write(*,*) 'From subroutine (internal) SUB2 called from ',str
  end subroutine sub2
end module aaa


program trymod
  
  use aaa

  call sub1()
  call sub2('Main')
  stop

end program trymod


-- 
Salvatore Filippone -- sfilippone@NOSPAMuniroma2.it


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