This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: F03 C interop..



On Thu, 29 Sep 2005, Richard E Maine wrote:

> On Sep 29, 2005, at 10:23 AM, Christopher D. Rickett wrote:
> 
> > Do you know what the plan is for implementing intrinsic modules?  Can they
> > simply be modules that are built by the compiler during the build process of
> > gfortran itself?
> 
> I could be wrong (and I don't know anything specific about gfortran plans
> anyway), but I don't think there is anything about the ISO_C_BINDING module
> that fundamentally has to be integrated with the compiler. That is, the
> compiler doesn't necessarily need to "know" much about the module. One could
> implement the module separately, with the only implication of intrinsicness
> being that it is found properly when INTRINSIC is specified on a USE statement
> (which could be done just by having a special directory that the compiler
> knows to look in).

I actually agree and had this plan in mind due to other work we've done here. 
With a separate project I've worked on we've done something similar to 
the iso_c_binding module, but for f90 so we could declare the interoperable 
types and some of the functions that we needed.  When looking at the module, 
it is something that configure could generate based on the architecture and 
the f03 draft (for types that don't apply to the given machine).

> 
> Basically, for this module, "intrinsic" means very little other than "provided
> with the compiler", plus "looked for in the right module search order". I
> don't know what, if any gfortran plans have been made, but I think it *could*
> be done this way.

I think it could be done this way, and that this is possibly the most 
straight-forward way to do it.

> Parsing and using the BIND(C) syntax is also necessary to go very far with the
> f2003 interop stuff, but that's a separate issue from the module.

This I have begun.  The parsing and catching of the bind(c) with the name 
attribute isn't a big deal.  Right now the issue I've ran into is the 
TOLOWER that gfortran does to all chars when trying to match.  This can't 
happen in the f03 case because the binding labels have to be exactly as 
shown because that is what C will use.

Chris

> 
> -- 
> Richard Maine                |  Good judgment comes from experience;
> Richard.Maine@nasa.gov       |  experience comes from bad judgment.
>                             |        -- Mark Twain
> 
> 


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