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: Procedure Pointers: a first patch


Hi Janus,

Janus Weil wrote:
here goes another update to my procptr patch
Great.

Here are some things which do not work:

implicit none
intrinsic sin
procedure(),pointer :: foo
foo => sin
print *, sin(4.4)
print *, foo(4.4)
end

Gives the error:

Error: Symbol 'foo' at (1) has no IMPLICIT type
Error: Symbol 'sin' at (1) has no IMPLICIT type

* * *

implicit none
intrinsic sin
real, external, pointer :: foo
foo => sin
end

gives the error:

Error: Function 'sin' requires an argument list at (1)

* * *

implicit none
interface
 subroutine bar()
 end subroutine bar
end interface
pointer :: bar
foo => bar
end

gives the error:

Error: Unexpected use of subroutine name 'bar' at (1)

* * *

procedure(), save, pointer :: z => null()
if(associated(z)) call z()
end

Error: PROCEDURE attribute conflicts with SAVE attribute in 'z' at (1)

* * *
procedure(), pointer :: z => null()
if(associated(z)) call z()
end

Error: 'pointer' argument of 'associated' intrinsic at (1) must be a POINTER

* * *

external bar
procedure(), pointer :: z => null()
z => bar
call z()
end

Dump shows that z is never initialized by zero.

Tobias


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