Re: Pointers to functions: Is this the right [f03] syntax?



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.

--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
.



Relevant Pages

  • Re: "Must instantiate controlled types at library level." Why?
    ... > The array bounds become unknown. ... > just the size of an pointer. ... It also show that operators attached to a reference type act ... > the compiler will stop creating copy constructors and warn you if you ...
    (comp.lang.ada)
  • Re: Mex Overflow Error Using Free Borland Compiler
    ... >>>would clean up a lot of code by eliminating the pointer dereferences. ... >>>guaranteed by the standard and should not be relied on. ... >>>You can try the GNU C compiler available on mingw or cygwin. ... >>>the Constraints are then both operands shall have arithmetic type. ...
    (comp.soft-sys.matlab)
  • Re: Anybody here endure C/Cpp? (.h to .inc conversion)
    ... Pascal or Stdcall convention... ... "PFNGLPOINTPARAMETERFEXTPROC" to be a type that's a pointer to a function ... DWORD, using a 32-bit compiler, with an address in it...adding the ... this is working on the premise that OpenGL does it like most others ...
    (alt.lang.asm)
  • Re: Why the compiler applies sign extension to unsigned data?
    ... I want the value of p to be made unsigned *before* the cast. ... want the cast to generate a sign extension. ... ULONG_PTR is ULONG and casting the pointer to ULONG_PTR first is the ... on the compiler and on the knowledge of the size of the ptr variable, ...
    (microsoft.public.development.device.drivers)
  • Re: OO programming - illumination? - whoopsie
    ... > represented by a host of loosely related arrays. ... > compiler and the memory allocators. ... A pointer is usually a word. ... organs can be further modeled to include cells and so on and so forth. ...
    (comp.lang.java.programmer)