I have a suspicion that this might be fixed in a more recent version of ifort, but I am seeing catastrophic errors for the following code.
MODULE mymod IMPLICIT NONE CONTAINS FUNCTION mv_char(in) RESULT(out) CHARACTER(:), POINTER, INTENT(in) :: in CHARACTER(:), POINTER :: out ALLOCATE(CHARACTER(LEN(TRIM(ADJUSTL(in)))) :: out) out = TRIM(ADJUSTL(in)) END FUNCTION mv_char END MODULE mymod PROGRAM caterr USE mymod IMPLICIT NONE CHARACTER(:), POINTER :: mystr=>NULL(), foo=>NULL() ALLOCATE(CHARACTER(3) :: foo) foo = 'foo' mystr => mv_char(foo) END PROGRAM caterrWhen compiled:
$ ifort cat_err.f90 cat_err.f90(20): catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error. mystr => mv_char(foo) -----------^ compilation aborted for cat_err.f90 (code 3)If line 5 is changed from
CHARACTER(:), POINTER, INTENT(in) :: into
CHARACTER(*), POINTER, INTENT(in) :: inI get the following compilation error which i can't understand:
$ ifort cat_err.f90 cat_err.f90(20): error #8298: If a dummy argument is allocatable or a pointer, the associated actual argument shall have deferred length parameter if and only if the dummy argument has deferred length parameter. [FOO] mystr => mv_char(foo) -------------------^ compilation aborted for cat_err.f90 (code 1)Is this a bug that has been seen before and is now fixed in the latest release?
In the second form of the code, is the compiler correct in issuing that error?