(j3.2006) Question on MOVE_ALLOC

Rafik Zurob rzurob
Tue Aug 23 17:12:02 EDT 2016


Hi Reinhold

> All compilers I tried (including yours) happily compile and run the 
> code, by the way.

XL Fortran diagnoses the test case:

> xlf2008 x.f -qsource
          7 |    if (i == 1) call move_alloc(x, y)
            .................................a..b.
a - "x.f", line 7.33: 1516-101 (S) In a pure subprogram, any object which 
is host-associated, is use-associated, is in a common block, is a dummy 
argument with INTENT(IN), is a pointer dummy argument of a pure function, 
or is a subobject of any of these, must not be an actual argument 
associated with a dummy argument with INTENT(OUT), INTENT(INOUT) or the 
POINTER attribute.
b - "x.f", line 7.36: 1516-101 (S) In a pure subprogram, any object which 
is host-associated, is use-associated, is in a common block, is a dummy 
argument with INTENT(IN), is a pointer dummy argument of a pure function, 
or is a subobject of any of these, must not be an actual argument 
associated with a dummy argument with INTENT(OUT), INTENT(INOUT) or the 
POINTER attribute.
** m02   === End of Compilation 1 ===
         12 |  use m02
            .......a..
a - "x.f", line 12.7: 1514-219 (S) Unable to access module symbol file for 
module m02. Check path and file permissions of file. Use association not 
done for this module.
1501-511  Compilation failed for file x.f.
>

As others have mentioned, the intent checking is what catches the error.

Regards

Rafik





More information about the J3 mailing list