Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!rutgers!apple!voder!pyramid!mikel From: mikel@pyrps5 (Mike Lipsie) Newsgroups: comp.lang.fortran Subject: Re: Are GOTOs restricted in Fortran 88 Message-ID: <46785@pyramid.pyramid.com> Date: 11 Nov 88 17:58:59 GMT Sender: daemon@pyramid.pyramid.com Reply-To: mikel@pyrps5.UUCP (Mike Lipsie) Organization: Pyramid Technology Corp., Mountain View, CA Lines: 43 In article <41017@aero.ARPA> campbell@aero.UUCP (L. Andrew Campbell) writes: >In article <50500088@uxe.cso.uiuc.edu> hirchert@uxe.cso.uiuc.edu writes: >> >>Debbie Whitfield(whit@pitt.UUCP) asks >>>/* ---------- "Are GOTOs restricted in Fortran 88" ---------- */ >> >.... and he answers: >>. FORTRAN 77 prohibited jumps into DO-loops. This restriction was retained in >> Fortran 8x and extended to apply to the new forms of DO loops as well. > >This is the 2nd time I have seen this statement made. Actually, one can jump >into the lexical range of a DO statement, provided one has jumped out of the >same DO. This is the old concept of "extended range" of a DO. The newer >terminology is: one is permitted to jump into an "active" do (one currently >being executed), and jumping out of a DO loop does not "inactivate" it. I >checked this information against a recent vendor-supplied manual, not against >the ANSI standard, but my recollection is that the ANSI standard permits the >above (i.e. it is not a vendor extension). Sorry to have to correct you, but since I just lost this argument I thought I would share my joy. :-) ANSI FORTRAN 77 11.10.2 "Active and Inactive DO-Loops." states: Once active, the DO-loop becomes inactive only when: ... (3) control is transferred to a statement that is in the same program unit and is outside the range of the DO- loop, ... The range of a DO-loop is defined (in 11.10.1) as all the statements between the DO statement and the terminating statement. Thus, the extended range was deleted. However, many vendors kept the extended range as an extension (they wanted to keep their customers happy). ----------- Mike Lipsie {allegra,cmcl2,decwrl,hplabs,ut-sally,utzoo}!pyramid!mikel Pyramid Technology Corp, Mountain View, CA +1 415 965 7200 ext. 4980