(j3.2006) pointer arguments to PURE procedures

Robert Corbett robert.corbett
Tue Sep 4 22:00:01 EDT 2012


On 09/04/12 16:43, Richard hendrickson wrote:
> A few days ago a really smart contributor to c.l.f asked about an apparent 
> change to PURE procedures in F2008.
>
> Basically, in F2003 it says
>
> "C1272 In a pure subprogram any designator with a base object that is in 
> common or accessed by host or use association, IS A DUMMY ARGUMENT OF A PURE 
> FUNCTION, is a dummy argument with INTENT (IN) of a pure subroutine, or an 
> object that is storage associated with any such variable, shall not be used in 
> the following contexts: ..."
>
> and in F2008  (C1283) the "IS A DUMMY ARGUMENT OF A PURE FUNCTION," is 
> missing.  I think it was omitted to allow for VALUE dummy arguments which can 
> be stored into without side effects.
>
> But, it looks like pointer dummy arguments were omitted from the forbidden 
> change list.  C1276 and 1277 refer to non-pointer dummy arguments.
>
> What about something like
>       PURE FUNCTION  YYY (X)
>        POINTER  X
>       YYY = 1.0
>       X = 2.0
>       END FUNCTION YYY
>
> I don't see anything that prohibits the X = 2.0 line, assuming X points to a 
> local variable in the caller.
>
> Am I missing something simple?
>
> Dick Hendrickson
>
>
>
>
> This body part will be downloaded on demand.

The "really smart contributor to c.l.f." in this context is
Ian Harvey.  I have not yet found anything that prohibits his
example.

Robert Corbett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.j3-fortran.org/pipermail/j3/attachments/20120904/3eff4401/attachment.html 



More information about the J3 mailing list