This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix FMT= with CHARACTER arrays (PR fortran/39865, take 2)



Hi,


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
      end subroutine

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(:,:) above). Therefore,
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).


Cheers,
- Tobi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]