(j3.2006) (SC22WG5.4609) Is this obscure USE usage legal?

N.M. Maclaren nmm1
Fri Dec 16 08:05:08 EST 2011


This arose on the gfortran mailing list.  I am 90% sure that there is a bug
in both gfortran and Intel, especially as Sun, Pathscale and NAG all accept
this code.  But I am only 90% sure, as it all hangs on exactly which
scoping unit the word 'local' applies to WHILE processing recursive
inclusion!  Until this moment, it had never crossed my mind to query that.

Please tell me if I have missed something.

Regards,
Nick Maclaren.



module mod1
integer :: axx=2
end module mod1

module mod2
use mod1
end module mod2

subroutine sub1
use mod1, oxx=>axx
use mod2
implicit none
print*,axx   !line compiles OK for gfortran, fails for Intel
end subroutine sub1

subroutine sub2
use mod2
use mod1, oxx=>axx
implicit none
print*,axx  !line fails to compile for gfortran, OK for Intel
end subroutine sub2




More information about the J3 mailing list