[Bug fortran/14901] New: Internal writes do not pad with blanks

schnetter at aei dot mpg dot de gcc-bugzilla@gcc.gnu.org
Fri Apr 9 19:53:00 GMT 2004


Internal writes do not seem to pad the string with blanks.  The following 
small programme illustrates the problem: 
 
subroutine x (a) 
  implicit none 
  character(*) a 
  print *,len(a),"[",a,"]" 
end subroutine x 
 
character s*10 
write (s, '("hello")') 
call x (trim(s)) 
write (s, '("hello     ")') 
call x (trim(s)) 
end program 
 
 
The programm should output 
 
           5 [hello] 
           5 [hello] 
 
but it prints instead 
 
          10 [hello 
 
 
 
 
] 
           5 [hello] 
 
indicating that there are leftover characters in the second half of the string 
s that should not be there.

-- 
           Summary: Internal writes do not pad with blanks
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: schnetter at aei dot mpg dot de
                CC: gcc-bugs at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list