(j3.2006) Residual problem with control transfer
Van Snyder
Van.Snyder
Thu Jun 10 20:04:03 EDT 2010
The description of loop termination (8.1.6.6.4 in N1830 and 10-007) says
that loop termination occurs when "Control is transferred from a
statement within the range of a DO construct to a statement that is
neither the <end-do> nor within the range of the same DO construct."
This means that a procedure reference within a DO construct causes loop
termination.
The condition should read "A Branch occurs within the range of the DO
construct and the branch target is neither the <end-do> nor within the
range of the same DO construct."
I've submitted an interp request paper to the server (also attached) to
repair this.
Van
-------------- next part --------------
J3/10-178
To: J3
Subject: Interpretation concerning loop termination
From: Van Snyder
Date: 10 June 2010
----------------------------------------------------------------------
NUMBER: F08/xxxx
TITLE: Does a procedure reference cause loop termination?
KEYWORDS: branch, transfer of control, loop termination, procedure
reference
DEFECT TYPE: Erratum
STATUS: Under consideration
QUESTION:
Consider the following DO construct
DO
CALL SUB
END DO
According to subclause 8.1.6.6.4 in N1830, loop termination occurs when
"Control is transferred from a statement within the range of a DO
construct to a statement that is neither the <end-do> nor within the
range of the same DO construct."
A subroutine reference is a transfer of control.
The first executable statement of SUB is not within the range of the DO
construct.
Does the loop terminated when SUB is invoked?
ANSWER:
It is not intended that execution of a DO construct be terminated by a
procedure reference. Edits are provided to correct this.
EDITS:
Replace the fourth item in the bulleted list in subclause 8.1.6.6.4 Loop
termination with the following:
"o A branch occurs within the range of a DO construct and the branch
target statement is neither the <end-do> nor within the range of the
same DO construct."
SUBMITTED BY: Van Snyder
HISTORY:
----------------------------------------------------------------------
More information about the J3
mailing list