This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]