This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
r124256 - in /branches/fortran-experiments
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: fortran at gcc dot gnu dot org
- Date: Fri, 27 Apr 2007 21:17:07 -0700
- Subject: r124256 - in /branches/fortran-experiments
----- Forwarded message from kargl@gcc.gnu.org -----
Author: kargl
Date: Sat Apr 28 05:11:29 2007
New Revision: 124256
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124256
Log:
Merged revisions 123029-123122 via svnmerge from
svn+ssh://kargl@gcc.gnu.org/svn/gcc/trunk
Gang,
This merge required the following patch. The diff
with c_ptr_tests_8_funcs.c is obvious because malloc.h
is nonstandard and malloc() has been defined in stdlib.h
for ages. The patch to interface.c ws needed to workaround
pault's removal of derived_type member in the namespace
structure. It's not entirely clear if the 2nd diff is
correct, but a regtest passed with it.
--
steve
Index: gcc/testsuite/gfortran.dg/c_ptr_tests_8_funcs.c
===================================================================
--- gcc/testsuite/gfortran.dg/c_ptr_tests_8_funcs.c (revision 124232)
+++ gcc/testsuite/gfortran.dg/c_ptr_tests_8_funcs.c (working copy)
@@ -1,7 +1,7 @@
/* This file provides auxilliary functions for c_ptr_tests_8. */
-#include <malloc.h>
#include <stdio.h>
+#include <stdlib.h>
extern void abort (void);
Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c (revision 124232)
+++ gcc/fortran/interface.c (working copy)
@@ -1163,13 +1163,18 @@ compare_parameter (gfc_symbol *formal, g
{
gfc_ref *ref;
- /* if the formal arg has type BT_VOID, it's to one of the iso_c_binding
- * procs c_f_pointer or c_f_procpointer, and we need to accept
- * most pointers the user could give us. this should allow that.
- */
- if(formal->ts.type == BT_VOID)
- return 1;
-
+ /* If the formal arg has type BT_VOID, it's to one of the iso_c_binding
+ procs c_f_pointer or c_f_procpointer, and we need to accept most
+ pointers the user could give us. This should allow that. */
+ if (formal->ts.type == BT_VOID)
+ return 1;
+
+ 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;
+
if (actual->ts.type == BT_PROCEDURE)
{
if (formal->attr.flavor != FL_PROCEDURE)