On Apr 17, 7:32=A0am, "James Van Buskirk" <not_va...@[EMAIL PROTECTED]
> wrote:
> "Damian" <dam...@[EMAIL PROTECTED]
> wrote in message
>
>
news:d94b1b92-9b69-4684-ab81-7ffc955aa7e1@[EMAIL PROTECTED]
>
> On Apr 17, 6:24 am, angelv <txibi...@[EMAIL PROTECTED]
> wrote:
>
> > > Do you know of any more or less up-to-date table describing the
> > > implemented features of each compiler? For an application I'm
> > > writting, I would very much like to use procedure pointers, but the
> > > (little) search I've done in this group and in the PGI reference
> > > manual didn't show up anything conclusive (there was an interesting
> > > discussion about this a couple of years ago in this newsgroup, but I
> > > wonder if things have chanced for the better since then).
> > I don't think PGI sup****ts procedure pointers, but if you can get your
> > hands on a beta copy of their next release (7.2?), I believe it has
> > most of the C interoperability features of Fortran 2003. =A0In that
> > case, you might be able to use C function pointers instead. =A0I know
> > this works with gfortran 4.3.0.
>
> He might be able to use C_FUNPTRs untils he feels the need to invoke
> one of the procedures, at which time he will once again feel the
> lack of procedure pointers in gfortran 4.0. =A0It is possible to work
> around this with cray pointers, and that's what I do at the present
> time. =A0Maybe it would be a good thing to write also the procedure
> pointer code next to the cray pointer code and comment it out so
> that when the time comes it will be relatively easy to change to
> the standard syntax when gfortran catches up.
>
> --
> write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
> 6.0134700243160014d-154/),(/'x'/)); end
Oops... I should have mentioned that my use of a C function pointer
was to take the location of a Fortran procedure, pass that location to
a C++ procedure (wrapped by 'extern C') and then invoke the procedure
from C++. In my case, that made sense because there was a pre-
existing C++ code I wanted to call a Fortran code. In other cases,
would it work to create an ad hoc C wrapper exclusively for invoking
the fortran procedure via a C_FUNPTR? I'm imagining the additional
coding would be pretty minimal and it would be standards-conforming
and therefore ****table. On the one hand, the Fortran code would be
limited to receiving C types. On the other hand, one of those C types
could actually be a void * pointing to whatever you want, even a
derived type. I can post some demonstration code if so desired.
Damian


|