------- Comment #5 from janus at gcc dot gnu dot org  2009-06-23 15:43 -------
(In reply to comment #2)
> The missing checks are due to the following code in interface.c
> (compare_parameter):
> 
>   if (formal->ts.type == BT_DERIVED
>       && formal->ts.derived && formal->ts.derived->ts.is_iso_c
>       && actual->ts.type == BT_DERIVED
>       && actual->ts.derived && actual->ts.derived->ts.is_iso_c)
>     return 1;

In my opinion this code is some kind of workaround for a lower-lying problem.
It just turns off the type checking, which is definitely not the right thing to
do (as this PR shows).

The actual bug, which causes the failure of iso_c_binding_rename_1.f03, seems
to be specific to ISO_C_BINDING with use-renaming. I tried to reproduce this by
use-renaming ordinary derived types, but did not succeed.

If you look at the error messages in iso_c_binding_rename_1.f03, something
definitely goes wrong there:

iso_c_binding_rename_1.f03:29.29:

    if(.not. my_c_associated(my_ptr)) then
                             1
Error: Type mismatch in argument 'c_ptr_1' at (1); passed TYPE(my_c_ptr) to
TYPE(my_c_ptr_0)

This error happens in the routine 'sub1', where the type 'my_c_ptr_0' is not
even accessible.


-- 


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

Reply via email to