This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

Official Fortran standards


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



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