This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Official Fortran standards
- From: "Maciej Z. Pindera" <mzpnet at directvinternet dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 19 Jun 2002 22:08:43 -0500
- Subject: Official Fortran standards
- Organization: CFD Research Corp.
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