Hi!

The following program

program a
   character(len=10) :: str

   str = '123'
   write( str, '(a,i1)' ) trim(str),4
   print*,str
end program a

outputs

[EMAIL PROTECTED] fem]$ gfortran -o a a.f90; ./a
 4

all other compilers i've tried (sun f90, xlf, g95, ifort) seem to agree the
output should be
 1234

Regards, Juha


-- 
           Summary: write to internal unit from the string itself gives
                    wrong result ?
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jpr at csc dot fi


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

Reply via email to