This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix FMT= with CHARACTER arrays (PR fortran/39865, take 2)
Jerry DeLisle wrote:
Hmm, g77 does compile the following without complaint.
subroutine foo (a)
complex :: a(1:5,1:10)
c complex :: b(:,:)
write (*, fmt=a) 1
c write (*, fmt=b(3,2)) 1
In this case maybe give an error unless -std=legacy, since it goes
against all standards from f77 on, and warn otherwise. I would sure hope
nobody is actually using this.
Jakub, if you are aware of s specific user issue with all this, let us
know, If not, I would like to see a hard error and be done with this.
My take on this: we have to support Hollerith formatting for backwards
compatibility. But we don't have to support Hollerith formatting
combined with Fortran 90 constructs, as we don't want new code written
with this ugly extension. The gaps in the arrays Jakub was talking
about can only arise with Fortran 90 constructs (viz complex :: b(:,:)
write(*, fmt=b(3,2)) 1
should give a hard error in my opinion "Error: legacy hollerith
formatting is not allowed with assumed shape array" (modulo terminology,
I always forget what is assumed-size, assumed-shape etc).