This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/51589] Modification of loop index variable by intent(out) or intent(inout) procedures
- From: "w6ws at earthlink dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 17 Dec 2011 19:04:12 +0000
- Subject: [Bug fortran/51589] Modification of loop index variable by intent(out) or intent(inout) procedures
- Auto-submitted: auto-generated
- References: <bug-51589-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51589
--- Comment #5 from Walter Spector <w6ws at earthlink dot net> 2011-12-17 19:04:12 UTC ---
It seems like intent information should be available when the procedures are
USE associated, as opposed to the internal procedures. However gfortran does
not diagnose that case either. Here is an expanded test case:
module intent_mod
implicit none
contains
subroutine submod1 (idx)
integer, intent(inout) :: idx
idx = 42
end subroutine
subroutine submod2 (idx)
integer, intent(out) :: idx
idx = 11
end subroutine
end module
program intents
use intent_mod
implicit none
integer :: i
do, i=1,10
call sub1 (i)
print *, i
call sub2 (i)
print *, i
call submod1 (i)
print *, i
call submod2 (i)
print *, i
end do
contains
subroutine sub1 (idx)
integer, intent(inout) :: idx
idx = 42
end subroutine
subroutine sub2 (idx)
integer, intent(out) :: idx
idx = 11
end subroutine
end program