A little pointer on POINTER in data would be helpful

Steve Kargl sgk@troutmask.apl.washington.edu
Sat Mar 24 22:03:00 GMT 2018


On Sat, Mar 24, 2018 at 01:51:40PM -0700, Steve Kargl wrote:

(snip)

> 
> So, I believe the standard says the following code is conforming
> 
> subroutine sub(i)
>    integer, intent(in) :: i
>    integer, save, target :: j
>    integer, pointer :: k
>    data k/j/
>    if (i /= 0) then
>       j = i
>    else
>       j = 42
>    end if
>    print *, k
> end subroutine

(snip)

> 
> Of course, I could be wrong.
> 

Of course, finding a trivially stupid patch to accept the
above was easy.  Making sure that it doesn't allow anything
to go sideways is the challenge.  Still need to get some
confirmation that the above is valid.

-- 
Steve



More information about the Fortran mailing list