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: Problem with procedure pointers passed as arguments


On Friday 12 February 2010, N.M. Maclaren wrote:
> On Feb 12 2010, Andrew Benson wrote:
> > I'm experiencing a problem with procedure pointers passed as arguments to
> > subroutines (using v4.4.0). The subroutine associates the pointer with
> > some procedure. The calling unit then attempts to call the procedure
> > pointed to by this pointer. When I run this under OpenMP I sometimes get
> > an unassociated pointer returned, even though it is associated in the
> > subroutine (and the code therefore crashes).
> 
> While gfortran MAY choose to support this, you are so far up the creek of
> undefined behaviour that you won't get back even if the crocodiles don't
> eat your paddle.  I.e. even if you get it to work, don't expect it to be
> portable over compiler or even time.
> 
> OpenMP's specification of how data pointers are handled (in C, C++ or
> Fortran) is a right mess - that's mostly not it's fault, but it needn't
> have added to the confusion.  Anyway, procedure pointers date from 2003,
> and (as I understand it) OpenMP's Fortran aspects haven't been revisited
> in depth since then.  I could say more, but shall refrain on the grounds
> of tact to the developers of OpenMP.

That's interesting to know. Unfortunately this functionality is central to my 
code. I may have to think about parallelizing it at a lower level - below 
where this handling of procedure pointers is required.

Thanks,
Andrew.

-- 

* Andrew Benson: http://www.tapir.caltech.edu/~abenson/contact.html

* Galform: http://www.galform.org


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