Document Number: J4/02-0154
July 24, 2002
Page 1 of 1
Defect Report
Author:
Artur Reimann
Subject:
Call Convention & Entry Convention
References:
Base Document ISO/IEC 1989:2002(E)
JUSTIFICATION:
I believe that the rules for call convention and/or entry convention need to be corrected and clarified.
DISCUSSION:
8.3.1.1.1 specifies this:
“When a CALL statement, a CANCEL statement, or a program-address-identifier references a program-name that names
a compilation unit:
1) If the CALL statement, CANCEL statement, or program-address-identifier specifies a program-prototype-name, the
naming convention and mapping used for the program-name is determined by the entry convention of the called program;
2) otherwise: … “
1.
One problem is that the entry convention of the called program is not known before the program is actually
identified and inspected. This is not the case at compile time. The name of the program is not known when the
call is a dynamic call, for example; if it’s specified as a literal, there may at compile time be a program that has
the required name but is not even related to the program to be loaded at runtime. In fact, no such program may
even exist at compile time. This is not a flaw, but a feature: It allows developing an application by just providing
prototypes initially and the corresponding programs at a later time. Proposed solution: Change “entry convention
of the called program” to “entry convention of the specified prototype”. At runtime, CALL GR 7 makes sure that
the prototype determines the characteristics of the called program: Thus this change is justified.
2.
There is still another problem when the prototype does not have an ENTRY CONVENTION clause.
How is the entry convention determined in this case? The last paragraph and sentence of 11.8.5.3
GR 2 reads: “The entry convention used when this clause is not specified is implementor-defined, except that
the naming convention and mapping of method-names and program-names are as specified in 8.3.1.1.1, User-
defined words.” (BTW, isn’t is strange that this is part of GR 2 rather than a separate rule?) Coming back to
8.3.1.1.1, there are rules for user-defined words in general, but in the last two paragraphs of the section there
are more specific rules for the case when a method-name is reference by an INVOKE statement or a program-
name by a CALL, CANCEL, or program-address-identifier; these rules in turn refer back to the “entry convention
of the called program” (which should be “prototype” as explained above). This is circular! The intent is probably
to apply the rules for user-defined rules in general, not those for their reference in INVOKE or CALL statements
etc. If that’s the case, the last paragraph of 11.8.5.3 should be changed to something like:
“3) The entry convention used when this clause is not specified is implementor-defined, except that the
naming convention and mapping of method-names and program-names are as specified for user-
defined words in general in 8.3.1.1.1, User-defined words.
NOTE The specific rules for INVOKE and CALL statements, specified in the last two paragraphs of
8.3.1.1.1, do not apply in this case.”