From janshep@watson.ibm.com  Thu Sep  7 19:44:29 1995
Received: from watson.ibm.com (watson.ibm.com [129.34.139.4]) by dkuug.dk (8.6.12/8.6.12) with SMTP id TAA18313 for <sc22wg5@dkuug.dk>; Thu, 7 Sep 1995 19:44:23 +0200
Message-Id: <199509071744.TAA18313@dkuug.dk>
Received: from YKTVMV by watson.ibm.com (IBM VM SMTP V2R3) with BSMTP id 7341;
   Thu, 07 Sep 95 13:44:05 EDT
Date: Thu, 7 Sep 95 13:44:05 EDT
From: "Janice C. Shepherd ((914) 784-6313)" <janshep@watson.ibm.com>
X-Addr: J1-K10, Hawthorne I
        tieline 863
To: sc22wg5@dkuug.dk
Subject: 006 ballot

It's been pointed out to me that I neglected to include defect item
198 in the ballot I just issued, even though it was processed at
meeting 134.
I'll reissue the ballot notice to include 198.
Here is the text of 198.




NUMBER: 000198
TITLE: Characteristics of dummy procedures
KEYWORDS: argument - optional, characteristics, dummy procedures,
interface - explicit
DEFECT TYPE: Erratum
STATUS: X3J3 consideration in progress

QUESTION: Section 12.4.1.2 "Argument associated with dummy
procedures" states:

   "If the interface of the dummy procedure is explicit, the
    characteristics of the associated actual procedure must be the
    same as the characteristics of the dummy procedure (12.2)."

Section 12.2.1.2 "Characteristics of dummy procedures" states:

   "The characteristics of a dummy procedure are the explicitness
   of its interface (12.3.1), its characteristics as a procedure
   if the interface is explicit, and whether it is optional (5.1.2.6,
   5.2.2)."

This would imply that the following two examples are not standard conforming,
as the characteristics of ARG1 are not the same as the characteristics of
ARG2, and ARG2 has an explicit interface.

Example 1:

  SUBROUTINE S(ARG1)
    EXTERNAL ARG1
    INTERFACE
      SUBROUTINE SS(ARG2)
         INTERFACE
           FUNCTION ARG2(I)
           END FUNCTION
         END INTERFACE
      END SUBROUTINE SS
    END INTERFACE

    CALL SS(ARG1)    ! ARG2 has an explicit interface and that is
                     ! one of its characteristics but ARG1 has an
                     ! implicit interface as one of its characteristics
  END SUBROUTINE S

Example 2:

  SUBROUTINE T(ARG1)
    OPTIONAL ARG1
    INTERFACE
      FUNCTION ARG1(I)
      END FUNCTION
    END INTERFACE
    INTERFACE
      SUBROUTINE TT(ARG2)
         INTERFACE
           FUNCTION ARG2(I)
           END FUNCTION
         END INTERFACE
      END SUBROUTINE TT
    END INTERFACE

    IF (PRESENT(ARG1)) CALL TT(ARG1)  ! ARG1 is optional and that
                     ! is one of its characteristics. ARG2 is not
                     ! optional and that is one of its characteristics.
  END SUBROUTINE T

Are the code fragments standard conforming?

ANSWER: Yes, both code fragments are standard conforming providing in the
first code fragment that ARG1 is associated with a function whose arguments
and function result are consistent with those of ARG2.

Discussion: In the text cited from 12.4.1.2, the reference to 12.2 was there to
indicate that the requirement is that the characteristics of the dummy
procedure as a procedure match those of the characteristics of the actual
procedure as a procedure. The other characteristics of a dummy procedure (the
explicitness of its interface and whether it is optional) were not meant to be
included in the reference.

The characteristics of a procedure are:
  - the classification of the procedure as a function or subroutine
  - the characteristics of its arguments
  - the characteristics of its result value if it is a function

In the second code fragment the interface for ARG1 shows that these three
characteristics are the same for ARG1 and ARG2. In the first code fragment
these three characteristics of ARG1 are not known. For this code fragment to
be standard conforming these three characteristics of any procedure associated
with ARG1 must be the same as those of ARG2.

An edit is included to clarify the text in 12.4.1.2.

EDIT: Section 12.4.1.2, replace the second paragraph with [173:35-36]

   "If the interface of the dummy procedure is explicit, the
    characteristics listed in 12.2 must be the same for the associated
    actual procedure and the corresponding dummy procedure."

SUBMITTED BY: Janice C. Shepherd
HISTORY: 95-042 m132 submitted, with proposed response, approved 9-4,
         95-067 m132 alternate edit proposed, approved u.c.
         95-101 m133 X3J3 ballot, failed 13-5
         95-187 m134 alternate response proposed, approved u.c.


