[Bug fortran/45211] New: C interoperable error when compiling BIND(C) function in a module.

brtnfld at hdfgroup dot org gcc-bugzilla@gcc.gnu.org
Fri Aug 6 17:13:00 GMT 2010


gfortran (all versions 4.2-4.5) reports the error when trying to compile code
below:

Error: Type 'link_info' at (1) is a parameter to the BIND(C)  procedure
'liter_cb' but is not C interoperable because derived type 'info_t' is not C
interoperable

when I remove the module and compile just the function it compiles fine. info_t
is interoperable with C


MODULE liter_cb_mod
USE ISO_C_BINDING
CONTAINS
  FUNCTION liter_cb(link_info) bind(C)
    USE ISO_C_BINDING
    IMPLICIT NONE

    INTEGER(c_int) liter_cb

    TYPE, bind(C) :: info_t
       INTEGER(c_int) :: type
    END TYPE info_t

    TYPE(info_t) :: link_info

    liter_cb = 0

  END FUNCTION liter_cb

END MODULE liter_cb_mod


-- 
           Summary: C interoperable error when compiling BIND(C) function in
                    a module.
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: brtnfld at hdfgroup dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45211



More information about the Gcc-bugs mailing list