To: J3 10-225r1 From: Bill Long/Malcolm Cohen Subject: Interop TR: Requirement R9d Date: 2010 October 13 Reference: 10-165r2, N1820, 10-007 1. Introduction Requirement R9d in N1820 is: INTENT(OUT) ALLOCATABLE dummy arguments are permitted in a BIND(C) routine. It is the responsibility of the processor to deallocate the actual argument in any cross-language call. It is not required for the processor to handle this in C-to-C calls. 2. Discussion Fortran calling C is already handled by 6.7.3.2p6 of 1539-1, or it would be if 1539-1 permitted BIND(C) procedures to have ALLOCATABLE arguments. Since this is arguable, normative text for this requirement is preferred. C calling Fortran is not yet handled by the Fortran standard, not even arguably, so normative text in the TR is definitely required. For C calling C, INTENT(OUT) does not arise as C does not have the concept. 3. Edits to 10-165r2 [5:12+] 3.3p2+, before Note 3.1, insert new paragraphs and a note. "When a Fortran procedure that has an INTENT(OUT) ALLOCATABLE dummy argument is invoked by a C function, and the actual argument in the C function is a C descriptor that describes an allocated allocatable variable, the variable is deallocated on entry to the Fortran procedure. When a C function is invoked from a Fortran procedure via an interface with an INTENT(OUT) ALLOCATABLE dummy argument, and the actual argument in the reference to the C function is an allocated allocatable variable, the variable is deallocated on invocation (before execution of the C function begins)." ===END===