This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/45211] C interoperable error when compiling BIND(C) function in a module.
- From: "brtnfld at hdfgroup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Aug 2010 15:02:46 -0000
- Subject: [Bug fortran/45211] C interoperable error when compiling BIND(C) function in a module.
- References: <bug-45211-16432@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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