You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking about a workaround but my knowledge of Fortran is not enough for this.
Say, we have the following:
PROGRAM A
CHARACTER(LEN=256), TARGET :: t
CHARACTER(:), POINTER :: p
t ="123"
p => t(1:2)
PRINT*, '"', p, '"'
t ="456"PRINT*, '"', p, '"'END PROGRAM A
The program is expected to produce the following output:
"12" "45"
but, as reported, F_Front fails to process the source file.
The workaround I thought about was to introduce a buffer variable as follows:
PROGRAM A
CHARACTER(LEN=256), TARGET :: t
CHARACTER(:), POINTER :: p
CHARACTER(LEN=256), TARGET :: buf
t ="123"
buf = t(1:2)
p => buf
PRINT*, '"', p, '"'
t ="456"PRINT*, '"', p, '"'END PROGRAM A
F_Front is able to process this but the output of the program is not what we need (and it's obvious to me now why):
"12 " "12 "
Maybe someone could help me to come up with a proper workaround for this for the time being.
I assume that the following is legal Fortran:
However,
F_Front
fails to process it with the following error:"a.f90", line 10: compiler error: outx_pointerAssignStatement: Invalid argument, expected F_VAR or ARRAY_REF or F95_MEMBER_REF of FUNCTION_CALL.
The text was updated successfully, but these errors were encountered: