Skip to content

[flang][runtime] The character string for the DT editor has a 32 character length limit #158655

@DanielCChen

Description

@DanielCChen

Consider the following code:

module m
   type base
      integer(4) :: i
   end type

   interface write(formatted)
      subroutine writeformatted(dtv, unit, iotype, v_list, iostat, iomsg )
         import base
         class(base), intent(in) :: dtv
         integer,  intent(in) :: unit
         character(*), intent(in) :: iotype
         integer, intent(in)     :: v_list(:)
         integer,  intent(out) :: iostat
         character(*),  intent(inout) :: iomsg
      end subroutine
   end interface

end module

program fdtedit102
use m

   class(base), allocatable :: b1

   integer :: stat
   character(150) :: msg

   open (1, file = 'fdtedit102.1', form='formatted', access='sequential' )

   allocate ( b1, source = base(100) )

   write ( 1, "(DT'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefg')", iostat = stat, iomsg = msg )   b1
print*, stat
print*, msg
   if ( stat /= 0 ) ERROR STOP 1

end program

subroutine writeformatted (dtv, unit, iotype, v_list, iostat, iomsg)
use m, only: base

   class(base), intent(in) :: dtv
   integer, intent(in) :: unit
   character(*), intent(in) :: iotype
   integer, intent(in)     :: v_list(:)
   integer, intent(out) :: iostat
   character(*), intent(inout) :: iomsg

end subroutine

Flang complains

> a.out
 1005
 Excessive DT'iotype' in FORMAT; at offset 1 in format '(DT'ABCDEFGHIJKLMNOPQRS
 TUVWXYZabcdefg')'
Fortran ERROR STOP: code 1

It seems the limit for the length of the character string for the DT editor is 32.
What is the reason for setting up a limit?
XLF doesn't have a limit, but gfortran seems have a limit too, but larger than Flang.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flang:runtimequestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions