------- Comment #3 from burnus at gcc dot gnu dot org  2006-12-13 20:11 -------
CC: some more libgfortran/io experienced persons.

There seems to go something wrong when one uses
  format = "(1X,a,'xyz')"
  write(*,fmt=trim(format)) "A"
The result is:
 Az'

Expected:
 Axyz

The values in write_constant_string are:
  length = 3       // ok
  q[-1] = '' (0)   // should be  '
  q[0] = '' (0)    // should be  x
  q[1] = 'y' (121) 
  q[2] = 'z' (122)

The following works:
- no trim
- format = "(1X,'abc',a,'xyz')"
- format = "(1X,'abc',a)"
- format = "(1X,'xyz')"


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jvdelisle at gcc dot gnu dot
                   |                            |org, Thomas dot Koenig at
                   |                            |online dot de
          Component|fortran                     |libfortran
            Summary|valgrind errors for write   |write(*,myfmt="(1X,a,'xyz')"
                   |statement                   |) "A"  prints  Az' instead
                   |                            |of Axyz


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

Reply via email to