Official Fortran standards

Maciej Z. Pindera mzpnet@directvinternet.com
Tue Jun 18 20:34:00 GMT 2002


Hello,

A quick Fortran question that hopefully is appropriate to this group. 
 It concerns the official
status on a DO loop index once the loop is finished.  Specifically, 
given the following:

program test
implicit none
integer i,n
n=10

do i=1,n
  arbitrary code
enddo

write(6,*)i
stop
end

What do the Fortran standards say regarding the status of "i" at the 
"write" statement?
I have come across some discussions that claim that according to the 
standards,  "i" is undefined.
If that is true, would it still be true even if "i" was formally 
adeclared an integer as in above?
I realize that in many cases things like that depend on the compiler 
implementation.  G77 in the GCC bundle gives i=n+1.
I'd appreciate any info., chapter and verse if possible.  Many thanks,

Maciej



More information about the Gcc mailing list