[Bug fortran/38894] c_f_procpointer/c_f_pointer - add missing argument checking
burnus at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Jun 23 08:34:00 GMT 2009
------- Comment #4 from burnus at gcc dot gnu dot org 2009-06-23 08:34 -------
(In reply to comment #3)
> This patch gives the correct error messages for comment #1
> + && actual->ts.derived && actual->ts.derived->ts.is_iso_c
> + && (formal->ts.derived->attr.use_rename
> + || actual->ts.derived->attr.use_rename))
I think that is wrong - the problem is TYPE(c_PTR) vs TYPE(C_FUNPTR) and not
the renaming. I think that will fail for:
use iso_c_binding, c_ptr2 => c_ptr
type(c_ptr2) :: fun
procedure(), pointer :: bar
call c_f_procpointer(fun,bar) ! << fun is c_ptr not c_funptr
end
Maybe something using
(fsym.intmod_sym_id == actual.intmod_sym_id)
where intmod_sym_id is either ISOCBINDING_PTR / ISOCBINDING_FUNPTR. (That may
fail - I don't know how the interface is defined for c_f_{proc}pointer, it
might miss this information.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38894
More information about the Gcc-bugs
mailing list