11-164r1 To: J3 From: Nick Maclaren Subject: Interop TR: minor lifetime problems Date: 2011 June 29 Reference: N1854 When looking at the constraints, I noticed a few minor problems with the lifetime wording. One is that we need to say that an allocatable descriptor created by C must be unallocated before its lifetime ends, if that occurs before the program exits. The other is that the first sentence in 20:9-12 needs restricting to Fortran and to non-allocatable, non-pointer descriptors as far as the object itself is concerned to avoid forbidding the use of some of the functions in this TR! Edits to N1854: [20:9] Replace the first sentence of paragraph 3 by: "If a pointer to a C descriptor is passed as an actual argument to a Fortran procedure, the lifetime (ISO/IEC 9899:1999 6.2.4) of the C descriptor shall not end before the return from the procedure call. If an object is passed to a Fortran procedure as a nonallocatable, nonpointer dummy argument, its lifetime shall not end before the return from the procedure call." [20:12+] Add a new paragraph: "If the lifetime of a C descriptor for an allocatable object that was established by C ends before the program exits, the object shall be unallocated at that time."