I'm trying to do some black magic.....namely, I've created a C routine which performs a memset() on the array or structure passed to it:
typedef ptrdiff_t CFI_type_t; typedef struct CFI_dim_t_ { CFI_index_t extent; CFI_index_t sm; CFI_index_t lower_bound; } CFI_dim_t; typedef struct CFI_cdesc_t_ { void *base_addr; size_t elem_len; int version; CFI_attribute_t attribute; CFI_rank_t rank; CFI_type_t type; // Begin Intel-specific fields - these are for // Intel compiler/library use only and should // not be modified intptr_t intel_flags; intptr_t intel_reserved1; intptr_t intel_reserved2; // End Intel-specific fields CFI_dim_t dim[]; } CFI_cdesc_t; void fortran_init( CFI_cdesc_t *a ) { memset( a->base_addr, 0, a->elem_len ); return; }
My Fortran interface definition goes as such:
INTERFACE SUBROUTINE FORTRAN_INIT( A ) BIND(C, NAME='fortran_init') IMPLICIT NONE CLASS (*), INTENT(IN) :: A END SUBROUTINE FORTRAN_INIT END INTERFACE
When I compile this using version 15.0.2, everything works fine, and the execution behaves as-expected (I can view all the descriptor properties in the debugger). However, when I compile with the newest version of ifort, I get the following:
#8789: Polymorphic dummy argument to a BIND(C) procedure is not interoperable.
Should I be using a different prototype on the Fortran side to get the CFI_cdesc_t descriptor passed to it properly?
Thanks in advance.