This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch,Fortran] Update gfortran.texi for mixed-language programming


2009/6/2 Tobias Burnus <burnus@net-b.de>:
> Well, I also did. Updated patch attached. Thanks a lot for proof
> reading. ("call-by-reference" is indeed not a that good wording; I tried
> for a while, but I failed to come up with something better which is
> concise and clear - thus I left it as is.)
>
> OK for the trunk? Or has someone else more suggestions? I know there is
> still plenty of things which should be added or modified, but I would
> like to check in this patch soon.
>
> Tobias

Hi everyone,

since I have been heavily using the C interop things for a year or so,
I just took an interested look, and found it understandable and
concise, yet without serious omissions. Had this been around a year or
so ago, it would have saved me quite a lot of headaches, and will do
so for C interop newbies from now on. Nice job!

I'd be happy with documentation like this, but if I were to make
suggestions, how about

 neither C's unsigned integers nor C's functions with variable number
-of arguments have an equivalent in Fortran.
+of arguments have an equivalent in Fortran, nor do OPTIONAL
+arguments in Fortran have an equivalent in C.

because in my "early days" I was under the impression/delusion, that
the latter should be able to interoperate if only they pulled
themselved together... I also like this more, because it mentions both
sides.

Also, a concise list of things that are _not_ interoperable could come
in handy; I appreciate you did it the other way round, describing
topic-wise how things interoperate and peppering it with things that
don't work. I am thinking of an additional "no-go" checklist for the
untroubled mixed-language adventurer. Maybe something like (I'm not
familiar with this texi-stuff)

@node List of non-interoperable features
@subsection List of non-interoperable features
These features of C and Fortran are not interoperable and should be
avoided in Mixed-Language code. Some features will become
interoperable once TR 29113 is has been approved and implemented. Note
that this section is only intended as a reference of non-interoperable
features. Please refer to the other sections of this chapter for
details.

[how to add links in texi?]
[how does one do enums? like this?]

Non-interoperable features in C:
@enum
@item unsigned integer types and unsigned char,
@item unions,
@item structs with bitfields members,
@item structs with variable-length array members,
@item functions with variable number of arguments,

[and some more I forgot ...]

@end enum

Non-interoperable features in Fortran:
@enum
@item Kind parameters other than the ones defined in the
@code{ISO_C_BINDING} intrinsic module,
@item CHAR arguments with the LEN attribute,
@item assumed-shape or allocatable array arguments,

[what about passing array slices like foo(5:8) btw? I am hazy about this]

@item derived type members with the POINTER or ALLOCATABLE attributes,
@end enum


Cheers,
Dennis


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]