(j3.2006) a contradiction in Section 12.5.2.13

Bill Long longb
Sun Dec 13 21:46:24 EST 2009



Robert Corbett wrote:
> Section 12.5.2.13 of the Fortran 2008 FCD states
> 
>       While an entity is associated with a dummy argument,
>       the following restrictions hold.
> 
>       (1) Action that affects the allocation status of the
>           entity or a subobject thereof shall be taken only
>           through the dummy argument.
> 
> The end of Note 12.34 states
> 
>       If B were declared with the POINTER attribute,
>       either of the statements
> 
>            DEALLOCATE(A)
> 
>       and

Should this "and" be "or"?

> 
>            DEALLOCATE(B)
> 
>       would be permitted, but not both.
> 

Perhaps better yet, replace the sentence above with

   "If B were declared with the POINTER attribute,

       DEALLOCATE(B)

   would be permitted."


Bob's comment triggered a somewhat related question of how carefully the 
new 'dummy is a pointer but the corresponding actual is not' mode was 
checked against the various examples in the text. I assume /DATA did a 
thorough job. But all I recall from plenary discussion was that this was 
a simple and obvious extension, and such things often result in not so 
simple ramifications.


At [296:32-34] we say that, if the dummy is a pointer and the actual is 
not, then the actual argument shall be "a valid target for the dummy 
pointer in a pointer assignment statement".  I don't think we mean that 
literally.   Clearly, we intend to require that some of the rules for 
pointer assignment apply, such as that the actual argument has valid 
type, rank, and kind  parameters for the assignment.  But another 
requirement for a pointer assignment - that the target be visible in the 
current scope, is clearly not the case here.   Since the statement is 
partially conceptual, it is not so clear whether the actual has to have 
the TARGET attribute, though that requirement is clearly desirable.  We 
do say it at [510:6], but that is not normative text. It seems 
sufficiently important to say here as well.

Cheers,
Bill




> In the note, B is the dummy argument of a subroutine
> INNER that is argument associated with the pointer
> variable A.  According to the text quoted above,
> actions that affect the allocation status of the
> entity shall be taken only through the dummy argument.
> Thus, the statement
> 
>            DEALLOCATE(A)
> 
> is not permitted.
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3

-- 
Bill Long                                           longb at cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101





More information about the J3 mailing list