Re: Pointers to functions: Is this the right [f03] syntax?
- From: "Andy" <andyv@xxxxxxxxxxxxxx>
- Date: 21 Jun 2006 00:41:23 -0700
Richard E Maine wrote:
Pere <constans@xxxxxxxxxxxxx> wrote:
I am testing the f03 pointer to procedure functionality on the g95...
compiler. This feature works smooth for subroutine procedures, but the
compiler seems 'confused' when pointees are functions. It issues the
error "Unexpected array reference".
So, the question is, is this the right syntax for pointer to functions?[code elided]
Looks ok to me off-hand. Not that I've had the opportunity to try this
stuff on a compiler yet, but from F2003:
R1217 function-reference is procedure-designator (
[actual-arg-spec-list])
R1219 procedure-designator is procedure-name
or (some other options)
c1223(R1219) A procedure-name shall be the name of a procedure or
procedure pointer.
Which is to say that a function reference using a procedure pointer
looks just like one using the procedure name directly. This is analagous
to data pointers; the pointer is automatically dereeferenced.
I've made a couple fixes and the current g95 can compile and run this
code fine now. I am worried that things may be a little too loose in
that the pointer p in the original code points to a subroutine, then
later on a function, though I can't seem to find anything prohibiting
that. Did I miss something?
Andy
.
- Follow-Ups:
- Re: Pointers to functions: Is this the right [f03] syntax?
- From: Richard E Maine
- Re: Pointers to functions: Is this the right [f03] syntax?
- From: Reinhold Bader
- Re: Pointers to functions: Is this the right [f03] syntax?
- References:
- Pointers to functions: Is this the right [f03] syntax?
- From: Pere
- Re: Pointers to functions: Is this the right [f03] syntax?
- From: Richard E Maine
- Pointers to functions: Is this the right [f03] syntax?
- Prev by Date: Re: Algorithm help for unique string searching/counting within an array.
- Next by Date: Re: help for reading a binary file
- Previous by thread: Re: Pointers to functions: Is this the right [f03] syntax?
- Next by thread: Re: Pointers to functions: Is this the right [f03] syntax?
- Index(es):
Relevant Pages
|