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

            Bug ID: 98825
           Summary: Unexpected behavior of FORTRAN FORMAT expressions when
                    suppressing new line with '$'
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: max.pd at gmx dot de
  Target Milestone: ---

Created attachment 50046
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50046&action=edit
commented FORTRAN77 code for bug reproduction

!> given a format statement like this:

   10 FORMAT (I3,$)

!> the program should suppress a new line
!> on formatting data for format expressions
!> ending with ',$'. This works well for
!> single values:

      WRITE (*,10) 1

!> The unexpected behavior occurs
!> When multiple values are given:

      WRITE (*,10) 2,3,4,5

!> Now the program will suppress
!> only the last new line. This is
!> unexpected behavior, as the whole format
!> expression should apply to each value,
!> not only to the last one.

!> You can reproduce the unexpected behavior
!> compiling this bug report.
!> A copy of this source code is attached.

      PRINT *
      PRINT *,' correct output should look like this:'
      PRINT *,' 1  2  3  4  5'
      END

Reply via email to