[Fortran-experiments] Bind(c) first experiences
Christopher D. Rickett
crickett@lanl.gov
Wed Jan 17 18:59:00 GMT 2007
> Hi Chris,
>
> Christopher D. Rickett wrote:
> > thanks for sending me your code. i tried it out, and the output from
> > gfortran is similar to that of NAG.
> Thanks. I probably have an too old version.
> Your patch, http://gcc.gnu.org/ml/fortran/2007-01/msg00301.html is not
> checked in yet, is it?
not that i know of. Steve was planning on looking at it soon.
> I probably should apply the patch first, before continue doing some tests.
> Are there further changes or is that patch up to date?
not anymore. i just made a couple of minor changes to add a test for the
second arg of c_f_pointer to make sure it has the pointer attribute.
also, i mark c_ptr and c_funptr as bind(c) since it's required for them to
be interop and i'm now enforcing that. there is a new testcase for this.
i'll try and submit this small patch today.
> What is actually the procedure for applying patches to the branch?
i'm not sure. i create a diff with svn and submit it to the list. is
there anything else i need to be doing?
>
> (We should by the way also merge the trunk up to the branch and
> consolidate the VALUE implementation.)
i'm hoping to look at this soon, but if anyone else wants to volunteer
that would be great. :-) there is some other work that needs done to the
patch before entering the trunk, including finishing the c_f_pointer
versions in iso_c_binding.c/h for the types/kinds not listed yet. this
should be fairly straight-forward since they all have the same pattern.
> Regarding to your last patch,
> http://gcc.gnu.org/ml/fortran/2007-01/msg00301.html
>
> + * to generate. If <code>c_ptr</code> is given, then
> <code>c_null_ptr</code>
>
> I think the coding convention is not to use "<code>...</code>" (at
> least none of the other gfortran files do)
i'll go through and remove them and change my function comment blocks to
the style used in gfortran now.
>
> +static void gen_special_c_interop_ptrs (const char *kinds[],
> + const char *module_name)
>
> If you use
>
> +static void
> +gen_special_c_interop_ptrs (const char *kinds[],
>
> one can grep for ^gen_special_c_interop_ptrs to find the function
> itself (and not the use of the function). This seems to be the coding
> convention in gfortran.
thanks. i'll change that too.
Chris
More information about the Fortran
mailing list