This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Fortran-Experiments]: patch for c_ptr/c_funptr
- From: Tobias Burnus <burnus at net-b dot de>
- To: "Christopher D. Rickett" <crickett at lanl dot gov>
- Cc: fortran at gcc dot gnu dot org
- Date: Thu, 08 Mar 2007 11:59:41 +0100
- Subject: Re: [Fortran-Experiments]: patch for c_ptr/c_funptr
- References: <Pine.LNX.4.64.0703071657440.12438@lennox.lanl.gov>
Hi Chris, hi all,
Christopher D. Rickett wrote:
> the patch is fairly large, but the majority of it is simply whitespace
> and style changes in the libgfortran/intrinsics/iso_c_* files. the
> goal of this patch is to convert the iso_c_binding derived types into
> void ptrs. this patch should at least be a start to that.
>
> bootstrapped and regtested on x86 with no new failures.
I did test a slightly earlier version of this patch successfully,
including check-gfortran -m32. I build (but not bootstrapped) this patch
on x86_64-unknown-linux-gnu and did make check (-m64) without new failures.
Additionally, I skimmed over the patch.
Thanks for the patch.
Three tiny nits:
Index: gcc/fortran/trans-expr.c
+ /* Try simply setting expr_type to EXPR_NUL, which should result
s/NUL/NULL/
Index: gcc/fortran/symbol.c
@@ -3583,6 +3585,8 @@ generate_isocbinding_symbol (const char
--------------------
tmp_sym->attr.is_bind_c = 1;
+ tmp_sym->attr.referenced = 1;
+
tmp_sym->ts.derived = tmp_sym;
--------------------
I think you used spaces instead of tabs here (last line has a tab,
others have spaces).
Index: libgfortran/intrinsics/iso_c_binding.c
+/* Set the fields of a Fortran pointer descriptor to point to the
+ given C address. It uses <code>c_f_pointer_u0</code> for the common
"<code>" should be removed.
Tobias