[J3] Can a procedure pointer have character(*) result type?
Steve Lionel
steve at stevelionel.com
Tue Nov 29 20:28:36 UTC 2022
On 11/29/2022 2:10 PM, Daniel C Chen via J3 wrote:
> 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.
Others have noted the lack of a required interface for a call to a
procedure with a pointer dummy.
I was wondering if the following constraints were relevant:
C722 A function name shall not be declared with an asterisk
type-param-value unless it is of type CHARACTER and is the name of a
dummy function or the name of the result of an external function.
C723 A function name declared with an asterisk type-param-value shall
not be an array, a pointer, elemental, or pure. A function name declared
with an asterisk type-param-value shall not have the RECURSIVE attribute.
C722 probably not, but C723 suggests to me that it being a procedure
pointer is a violation. I wasn't certain, though, that the declaration
of proc was considered a "function name". I think it is, but am open to
other views.
From an implementation viewpoint, I don't see a problem with this usage
as it requires no information not present in the declaration of proc.
Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20221129/7cb53a6f/attachment.htm>
More information about the J3
mailing list