Found at
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/220286db98888bb4#
The following program is rejected with the bogus message that the derived type
is not interoperable - it works if one moves the type declaration out of the
interface statement. It also works with SEQUENCE instead of BIND(C).
RESULTAT, SIGNE) bind(C, name='gsl_sf_lngamma_sgn_e_wrapper')
1
Error: Type 'resultat' at (1) is a parameter to the BIND(C) procedure
'gsl_sf_lngamma_sgn_e_wrapper' but is not C interoperable because
derived type 'gsl_sf_result' is not C interoperable.
! use iso_c_binding
! type, bind(C) :: GSL_SF_RESULT
! real(c_double) VALEUR
! real(c_double) ERREUR
! end type
interface
integer(c_int) function gsl_sf_lngamma_sgn_e_wrapper(X, &
RESULTAT, SIGNE) bind(C, name='gsl_sf_lngamma_sgn_e_wrapper')
use iso_c_binding
! import :: GSL_SF_RESULT
implicit none
type, bind(C) :: GSL_SF_RESULT
real(c_double) VALEUR
real(c_double) ERREUR
end type
real(c_double), intent(in) :: X
type(GSL_SF_RESULT), intent(out) :: RESULTAT
real(c_double), intent(out) :: SIGNE
end function
end interface
end
--
Summary: Derived type with BIND(C) - rejected as argument.
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40920