(j3.2006) paper 13-228

Malcolm Cohen malcolm
Tue Feb 5 19:45:43 EST 2013

Bill Long wrote:
>I'm not convinced the first alternate edit is correct.  If the dummy
>argument associated with the pointer function reference is never
>referenced in the procedure, the procedure appears to be still

Not so.  Any modification to an entity associated with a dummy argument that 
does not have the TARGET or POINTER attribute is required to go through the 
dummy argument.

(Think about what happens when some processors use pass-by-reference and some 
use copy-in/copy-out: in the first case the modification will happen and be 
effective, in the second the modification will be undone on procedure return.)

>Or if the procedure has only one argument and no other
>access to data outside the procedure (no USE or COMMON or host
>association) then the target of the corresponding actual argument
>pointer could be modified by the procedure and still have a conforming

You seem to be thinking it is being modified through that dummy argument, which 
was not the intent of my wording "target of the pointer result is modified".  I 
meant that to imply that it was being modified "other than through that dummy 

I left those words out because I thought it clear enough, this is only 
describing the exception not establishing any requirement, and the paragraph is 
already quite long, ... but if it's causing confusion we can easily put those 
words back in.

>I find the prospect of having programs that were perfectly legal in
>F2003 suddenly breaking to be disconcerting.


>   It is also disturbing to
>make codes that are legal now with F2008 suddenly no longer legal.

Regrettable though it is, it is not that infrequent an occurrence.  It usually 
doesn't rise to the level of ripping out a whole feature though.

>   As Bob says, "no good solutions".

Right, we have to pick the "least worst" one.  Opinions may differ as to which 
one that is.

There is a "third way", but I thought it even worse so didn't bother to write it 
up and make edits.  Viz, having a pointer function reference denote a variable 
only where these problems cannot arise.  But that would not only be a horrible 
inconsistency, but one of the prime places for wanting a pointer function 
reference to denote a variable was as an actual argument, so I thought that 
would be even less popular than the other possible solutions...

................................Malcolm Cohen, Nihon NAG, Tokyo. 

More information about the J3 mailing list