J3/01-288 Subject: Proposed answer for Interp 9 From: Malcolm Cohen To: J3 Date: 6th August 2001 ---------------------------------------------------------------------- NUMBER: 000009 TITLE: INTENT of MOLD argument to TRANSFER KEYWORDS: intrinsic function, TRANSFER, MOLD DEFECT TYPE: Interpretation STATUS: J3 consideration in progress QUESTION: In 13.3 [page 218:2], Fortran 95 states: The nonpointer dummy arguments of the generic intrinsic procedures in 13.14 have INTENT(IN) if the intent is not stated explicitly. In general, an actual argument that corresponds to a dummy argument that does not have the INTENT(IN) attribute does not need to be defined; you need to look at the particulars of the invoked procedure to decide if an actual argument needs to be defined before the invocation. It is likely that the only intrinsic procedure argument affected by this change in wording is the MOLD argument to the TRANSFER function. The value of the MOLD argument is never needed so there is no reason to define it before invoking TRANSFER in a Fortran 90 program. But, apparently it needs to be defined in a Fortran 95 program. This could break a program that uses a local name in a subroutine as the MOLD argument and doesn't always define the name with a value, or didn't save it. In this case, MOLD is like the arguments to the numeric inquiry functions, the "attribute" is a compile time characteristic, not a run-time "value" and should have the same exception as for the inquiry functions. (1) Was general statement about INTENT(IN) quoted above intentionally added to the Fortran 95 standard (how did it get into the standard)? (2) Is it the intent of the standard to apply this general statement to the MOLD argument of the TRANSFER intrinsic function? ANSWER: (1) Yes. (2) Yes, but this should not imply that the MOLD argument needs to be defined. An edit is supplied to clarify this situation. EDIT: [219:28+] Add new sentence to end of paragraph: "If the MOLD argument to this function is a variable, it need not be defined." SUBMITTED BY: Larry Rolison / Dick Hendrickson HISTORY: J3/97-246 m143 submitted WG5/N1452 Suggested revision J3/158-mjc-004 Revised. ----------------------------------------------------------------------