J3/97-246 Date: 20 October 1997 To: J3 From: Larry Rolison Subject: Interpretation Request: INTENT of MOLD Argument to TRANSFER NUMBER: 9 TITLE: INTENT of MOLD argument to TRANSFER KEYWORDS: intrinsic function, TRANSFER, MOLD DEFECT TYPE: Interpretation STATUS: X3J3 consideration in progress BACKGROUND: Dick Hendrickson submitted the background and questions contained in this interpretation request. Since there was no "official" reply forthcoming, I've taken the liberty (with Dick's kind permission) of submitting his informal question as a formal interpretation request. I have adapted his original email message and the reply he got from Rich Maine to the basic interp request format so some of the words in this interp request are mine, not theirs. Any errors of interpretation of their words are mine. This background section can probably be deleted in a later phase of the interpretation processing. 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. The cited text was became a part of the Fortran 95 standard as a result of applying the edits in Interpretation Request 184 to the Fortran 90 standard. The edits applied by Interpretation Request are included in Corrigendum 3. [ Thanks to Richard Maine for providing this clue. This comment should be removed in later processing. Just wanted to give credit where credit was due. ] (2) EDITS: SUBMITTED BY: Larry Rolison / Dick Hendrickson HISTORY: J3/97-246 m143 submitted ---------------------------------------------------------------------------- Larry Rolison lrr@cray.com Cray Research, A Silicon Graphics Company 655F Lone Oak Drive Eagan, MN 55121 ----------------------------------------------------------------------------