There is some kind of bug associated with use of x and t formats
together. See example below. Counting characters, you can see the 1st line
of output is wrong, while the 2nd and 3rd lines are correct. If the 1x
is omitted from the format, the output is correct.

This bug is observed both with  Windows 20061021 version, and 
linux-X86_64 20070305 version of gfortran.

-------------------------------------------------------------------

C:\source\test>type tft.f95
program t
   integer, parameter :: N = 9
   character(len=40) :: fmt
   character(len=2), dimension(N) :: y

   y = 'a '
   fmt = '(a,1x,(t7, 3a))'
   write(*, fmt) 'xxxx', (y(i), i = 1,N)
end program t

C:\source\test>gfortran -o tft tft.f95

C:\source\test>tft
xxxx   a a a
      a a a
      a a a

C:\source\test>


-- 
           Summary: gfortran bug with x and t format descriptors.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gay at sfu dot ca
  GCC host triplet: wtf does 'host triplet' mean?


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31051

Reply via email to