To: J3 11-173r1 From: Bill Long/Steve Lionel Subject: CFI_type_other split Date: 2011 June 28 Reference: WG5/N1854 Discussion: ----------- The collection of types in the current type code CFI_type_other bin includes some of substantially different nature. Also, the sign of CFI_type_other is confusing, as some types covered could suggest a positive value, while others clearly indicated negative. Splitting the collection would provide greater functionality. In particular, one of the presumed uses of the new interoperability facility is to provide interfaces to C routines that, in effect, copy blocks of data. Variables of types that represent only raw "data" are reasonable candidates for such copying, whereas types with components that have ALLOCATABLE or POINTER attributes are not. Thus, it would be advantageous to separate out the CFI_type_other to be only the non-copyable types. Furthermore, a type specifier for an interoperable derived type is a useful special case of copyable types. By moving Fortran intrinsic types for which there is no C counterpart (such as 128-bit real) out of the CFI_type_other collection, future expansion of the type list should be less disruptive. A new processor-dependent group of nonnegative specifiers for Fortran intrinsic types that are not represented by other type codes and Fortran derived types that do not have type parameters, type-bound procedures, final procedures, or components that are allocatable, pointer, or correspond to CFI_type_other is proposed. Also, CFI_type_struct is added to represent interoperable structs. The value of CFI_type_other is negative. Edits to N1854: -------------- [11:16] In the second sentence of 5.2.4 Macros para 7, after "shall be" insert " negative and" [11:17] After "specifiers." add a new sentence: "CFI_type_struct specifies a C struct that is interoperable with a Fortran derived type; its value shall be positive and distinct from all other type specifiers." [11:18+] Add a new paragraph following para 7 of 5.2.4 Macros: "Additional nonnegative processor-dependent type specifier values may be defined for Fortran intrinsic types that are not represented by other type specifiers and noninteroperable Fortran derived types that do not have type parameters, type-bound procedures, final procedures, nor components that have the ALLOCATABLE or POINTER attributes, or correspond to CFI_type_other." [12:Table 5.2] Before then entry for CFI_type_other, add a new line: "CFI_type_struct interoperable struct" [12:Table 5.2] Replace the C Type entry for CFI_type_other with: "Not otherwise specified" [21:4+] Add a new bullet item before the last bullet: "if the dynamic type of the effective argument is an intrinsic type with no corresponding type listed in Table 5.2, or a noninteroperable derived type that does not have type parameters, type-bound procedures, final procedures nor components that have the ALLOCATABLE or POINTER attributes, or correspond to CFI_type_other, one of the processor-dependent nonnegative type specifier values;"