Path: utzoo!attcan!uunet!modcomp!joe From: joe@modcomp.UUCP Newsgroups: comp.lang.fortran Subject: Re: Dubious Fortran Construct Message-ID: <11800009@modcomp> Date: 14 Dec 88 03:13:00 GMT References: <22994@sgi.SGI.COM> Lines: 29 Nf-ID: #R:sgi.SGI.COM:22994:modcomp:11800009:000:1233 Nf-From: modcomp.UUCP!joe Dec 13 22:13:00 1988 Dave Seaman (ags@j.cc.purdue.edu) writes: > In article <44400031@hcx2> bill@hcx2.SSD.HARRIS.COM writes: > > > >The X3J3 FORTRAN committee has considered this question, and an > >official interpretation will be published sometime in the near future, > > I was surprised to see this, because I see nothing ambiguous in the > standard. [...] Here are the relevant statements: > > 11.10.1 _Range_of_a_DO-Loop_. [...] More than one DO-loop may > have the same terminal statement. > > This means that the CONTINUE statement in the example is part of the > range of both loops. The GOTO statement in the example is not part of > the range of the inner DO-loop. Because the CONTINUE statement is being used as the terminating statement of two scopes, an ambiguity exists, since GOTO can only branch into a single scope. Which scope is selected is not stated by the f77 standard. Your implied intepretation of "select that scope which makes sense for the GOTO in question" is a nice feature that Smart Compilers (like mine (:->)) can implement. However, wording to *require* that behavior is not present in the standard. Hence any program that makes use of the ambiguity is nonstandard conforming. -- joe korty uunet!modcomp!joe