(j3.2006) pointer arguments to PURE procedures

Tobias Burnus burnus
Wed Sep 26 03:47:18 EDT 2012


Dear all,

I would like to come back to this thread. Seemingly,  pointer arguments 
of pure functions may be modified since Fortran 2008 - all seem to agree 
on that.

My question is whether that change was on purpose and should stay or 
whether it was an accidentally created loophole which should be plugged 
again? If the latter, it probably makes sense to fill an IR.

If the change was on purpose, can someone provide me with a rational?

Tobias

On 09/05/2012 04:00 AM, Robert Corbett wrote:
> 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
>
>
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3




More information about the J3 mailing list