(j3.2006) pointer arguments to PURE procedures

Richard hendrickson dick.hendrickson
Tue Sep 4 19:43:28 EDT 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.j3-fortran.org/pipermail/j3/attachments/20120904/5c85092b/attachment.html 



More information about the J3 mailing list