[J3] Can a procedure pointer have character(*) result type?
Daniel C Chen
cdchen at ca.ibm.com
Tue Nov 29 19:10:25 UTC 2022
Consider the following example:
character(2) :: cc
character(4), external :: foo
cc = "ab"
call sub(foo, cc)
end
subroutine sub(proc, arg)
character(*) :: arg
!character(*) :: proc !! This is OK
character(*), external, pointer :: proc !! Question: is this conforming?
print*, proc(arg)
end
function foo(arg)
character(*) :: foo, arg
foo = arg // "cd"
end function
Is it legal to declare a dummy procedure pointer to have character(*) result type? I couldn't find anything wording in the standard that disallow it, but want to confirm if this is a legal program.
Thanks,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20221129/1cda7196/attachment.htm>
More information about the J3
mailing list