07-213 To: J3 From: Van Snyder Subject: Interoperability of non-BIND derived types Date: 2007 May 04 NUMBER: TBD TITLE: Interoperability of non-BIND derived types KEYWORDS: Interoperability, derived type DEFECT TYPE: Error STATUS: TBD INTRODUCTION Subclause 15.3.4 of 04-007 says "A Fortran type is interoperable with a C struct type if the derived-type definition of the Fortran type specified BIND(C) (4.5.2), the Fortran derived type and the C struct type have the same number of components, and the components of the Fortran derived type have types and type parameters that are interoperable with the types of the corresponding components of the struct type. QUESTIONS Is a Fortran derived type for which BIND(C) is not specified interoperable with any C struct type? Does a Fortran derived type interoperate with a C struct type that has a different number of components? Does a Fortran derived type interoperate with a C struct type that specifies the same components in a different order? Does a Fortran derived type with a pointer or allocatable component that has interoperable type and type parameters interoperate with any C struct type? ANSWERS: None of these Fortran derived types are interoperable. EDITS: Replace "if" in the above quoted paragraph in subclause 15.3.4 by "if and only if". At the end of the third paragraph of subclause 15.3.4, the one that begins "There is no Fortran type..." insert a new sentence "A Fortran derived type that has a direct component with the POINTER or ALLOCATABLE attribute does not interoperate with any C struct type." SUBMITTED BY: Van Snyder HISTORY: m180 Submitted