[J3] surprisingly PURE

Shterenlikht, Anton anton.shterenlikht at hpe.com
Sun Apr 19 15:14:03 EDT 2020



> On 19 Apr 2020, at 18:17, Steven G. Kargl via J3 <j3 at mailman.j3-fortran.org> wrote:
> 
> For Bob's code, it seems odd to me that the Fortran standard
> would allow a variable available through host association in a
> pure subprogram to be indirectly (re)defined by pointer association.
> But, then again, I avoid the use of pointers in my own codes.

"odd" is not the right word.
As Bob said, "it should not be standard conformant",
yet I also cannot see which constraint it violates.

Interestingly of the 4 compilers I tried,
2 reject the pointer assignment in the derived type
and 1 gives ICE!
The 4th compiler accepts and outputs 2.0 at runtime.

Anton



More information about the J3 mailing list