This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



------- Comment #2 from brtnfld at hdfgroup dot org  2010-08-09 15:02 -------
If the type declaration is moved to the module scope the code compiles.

MODULE liter_cb_mod

USE ISO_C_BINDING

TYPE, BIND(C) :: MYFTYPE
  INTEGER(C_INT) :: I, J
  REAL(C_FLOAT) :: S
END TYPE MYFTYPE

CONTAINS

  FUNCTION liter_cb() bind(C)

    USE ISO_C_BINDING
    IMPLICIT NONE

    INTEGER(c_int) liter_cb

    TYPE(MYFTYPE) :: link_info

    liter_cb = 0

  END FUNCTION liter_cb

END MODULE liter_cb_mod

There was a discussion about the matter in comp.lang.fortran under the topic
"BIND(C) functions in a module error" as to the source of the problem. Since
there seems to be a work around I downgraded the severity.


-- 

brtnfld at hdfgroup dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]