https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65605

            Bug ID: 65605
           Summary: [4.9 Regression] Namelist mishandles delim
           Product: gcc
           Version: 4.9.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: jvdelisle at gcc dot gnu.org
          Reporter: jvdelisle at gcc dot gnu.org

Reported to me off list.  This is related to pr60148.  It is fixed on trunk by
the fix to pr63460 which did get backported to 4.9.  The fix to pr60148
probably needs to be backported to 4.9 as well.

Input:

 &theList
   mode      = 'on'
   dogs      = 'Rover',
               'Spot'
   cats      = 'Fluffy',
               'Hairball'
 /

Case:

integer ,parameter :: CL=80
integer ,parameter :: AL=4

character(CL) :: mode
character(CL) :: cats(AL)
character(CL) :: dogs(AL)
integer       :: ierr, k
character(CL) :: msg

namelist / theList / cats, dogs, mode

4 format (a4, "(", i1, ")='", a, "'")

msg     = 'none'
mode    = 'off'
cats(:) = '____'
dogs(:) = '____'

read (*, nml=theList, iomsg=msg, iostat=ierr)

print *, "ierr=",    ierr
print *, "message='"//trim(msg)//"'"

do k=1,AL
   print 4, "dogs", k, trim(dogs(k))
end do

print *, ""
do k=1,AL
   print 4, "cats", k, trim(cats(k))
end do

end

Reply via email to