Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!purdue!i.cc.purdue.edu!h.cc.purdue.edu!s.cc.purdue.edu!ags From: ags@s.cc.purdue.edu (Dave Seaman) Newsgroups: comp.lang.fortran Subject: Re: Dubious Fortran Construct Message-ID: <3684@s.cc.purdue.edu> Date: 14 Dec 88 22:45:26 GMT References: <22994@sgi.SGI.COM> <11800009@modcomp> Reply-To: ags@s.cc.purdue.edu (Dave Seaman) Organization: Purdue University Lines: 37 In article <11800009@modcomp> joe@modcomp.UUCP writes: [ You all know what the code example looks like by now ] >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. ^^^^^ A GOTO cannot branch INTO any scope whatsoever. See paragraph 11.10.8 of the standard. The important word here is INTO, meaning "from the outside to the inside". A GOTO can branch WITHIN as many scopes as it pleases, but it cannot enter a scope except through the top. There is no ambiguity. >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. I don't know who you are referring to here. You quoted my argument that the construct is illegal, so I take it you are addressing me. But I have never attempted to "interpret" that which is not allowed by the standard in the first place. I do not object to extensions, as long as it is understood that that is what they are. >However, wording to *require* that behavior is not present in >the standard. Hence any program that makes use of the ambiguity is >nonstandard conforming. You are correct in stating that standard does not require any particular behavior when confronted by a program that is not standard-conforming. As I have explained, there is no ambiguity: the program most definitely is not standard-conforming. The compiler may do absolutely anything it likes with the program, including refusing to compile it. Dave Seaman -- Dave Seaman ags@j.cc.purdue.edu