Hi All! Proposed patch to: Bug 100906 - Bind(c): failure handling character with len/=1 Bug 100907 - Bind(c): failure handling wide character Bug 100911 - Bind(c): failure handling C_PTR Bug 100914 - Bind(c): errors handling complex Bug 100915 - Bind(c): failure handling C_FUNPTR Bug 100916 - Bind(c): CFI_type_other unimplemented Patch tested only on x86_64-pc-linux-gnu. This patch deals with improving C interoperability. The identification of type and kind is improved, support for C_PTR and C_FUNPTR is introduced, non interoperability types are now properly marked as CFI_type_other. This patch partially depends on the patch: "PR fortran/93308/93963/94327/94331/97046 problems raised by descriptor handling" Thank you very much. Best regards, José Rui Fortran: Fixes to type and kind handling in ISO_Fortran_binding. gcc/fortran/ChangeLog: PR fortran/100907 PR fortran/100911 PR fortran/100915 PR fortran/100916 * decl.c (gfc_verify_c_interop): add missing C_PTR and C_FUNPTR as C interop types. * trans-array.c (gfc_conv_descriptor_type): new function to access the type field from the dtype descriptor field. * trans-array.h (gfc_conv_descriptor_type): new prototype. * trans-decl.c (convert_CFI_desc): add support for handlinng non C interop wide character type. * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): add support for CFI_type_other. libgfortran/ChangeLog: PR fortran/100906 PR fortran/100907 PR fortran/100911 PR fortran/100914 PR fortran/100915 PR fortran/100916 * ISO_Fortran_binding.h: adds helper macros to handle type and kind conversion between CFI and GFC descriptors. (_CFI_DECODE_TYPE): extract type from an encoded CFI type. (_CFI_DECODE_KIND): extract kind from an encoded CFI type. (_CFI_ENCODE_TYPE): encode a CFI type. * runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc): improvements to the handling of type and kind information. (gfc_desc_to_cfi_desc): improvements to the handling of type and kind information. gcc/testsuite/ChangeLog: PR fortran/100906 PR fortran/100907 PR fortran/100911 PR fortran/100914 PR fortran/100915 PR fortran/100916 * gfortran.dg/ISO_Fortran_binding_1.f90: * gfortran.dg/bind_c_array_params_2.f90: * gfortran.dg/PR100906.c: New test. * gfortran.dg/PR100906.f90: New test. * gfortran.dg/PR100907.c: New test. * gfortran.dg/PR100907.f90: New test. * gfortran.dg/PR100911.c: New test. * gfortran.dg/PR100911.f90: New test. * gfortran.dg/PR100914.c: New test. * gfortran.dg/PR100914.f90: New test. * gfortran.dg/PR100915.c: New test. * gfortran.dg/PR100915.f90: New test. * gfortran.dg/PR100916.c: New test. * gfortran.dg/PR100916.f90: New test.