http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57048
Bug #: 57048
Summary: [4.9 Regression] Handling of C_PTR and C_FUNPTR leads
to reject valid
Classification: Unclassified
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: [email protected]
ReportedBy: [email protected]
Reported by Angelo Graziosi at
http://gcc.gnu.org/ml/fortran/2013-04/msg00210.html
Using in file1:
module m
...
type t
type(c_funptr) :: funptr
end type
and in file2:
use iso_c_binding, ONLY: c_funloc
use m
type(t) :: x
...
x%funptr = c_funloc(proc)
fails with:
Error: Can't convert TYPE(c_funptr) to INTEGER(4) at (1)
The problem is that the .mod file only contains:
win32_types.mod:5 'C_funptr' '__iso_c_binding' '' 1 ((DERIVED UNKNOWN-INTENT
while the symtree is searched for "c_funptr".
Workaround: Editing the .mod file and changing C_funptr to c_funptr.