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/32170] string badly passed as function arguments



------- Comment #2 from mikael dot morin at tele2 dot fr  2007-05-31 19:04 -------
$ export FILE=test2
$ cat $FILE.f                                


      program testchar

      character(len=30), dimension(2) :: str2


      write(str2(1),*) "string1"
      write(str2(2),*) "string2"

      call test( str2 )
      call test( (/ "string1", "string2" /) )



      end program 

      subroutine test(chars)

      character(len=30), dimension(2) :: chars

      write(6,*) chars

      end subroutine
$

This case writes junk on the terminal

$ export FC=gfortran                         
$ $FC -v;$FC -o $FILE $FILE.f ; echo; ./$FILE
Lecture des spécification à partir de
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/specs
Target: x86_64-pc-linux-gnu
Configuré avec: /usr/src/gcc-4.1.2/configure --host=x86_64-pc-linux-gnu
--prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man
--enable-threads=posix --with-system-zlib --enable-languages=f95
--disable-multilib
Modèle de thread: posix
version gcc 4.1.2

  string1                       string2                      
 string1string2
                @
                 @      L%Ö«*  ^¤├Ö«*  ◆îIÖ«*  ¸â–Ô
$


$ export FC=/usr/local/bin/gfortran          
mik@wnn30119 scol/ragsl/progs $ $FC -v;$FC -o $FILE $FILE.f ; echo; ./$FILE
Utilisation des specs internes.
Target: x86_64-unknown-linux-gnu
Configuré avec: ../gcc-4.3-20070525/configure --enable-languages=fortran
--disable-multilib
Modèle de thread: posix
version gcc 4.3.0 20070525 (experimental)

  string1                       string2                      
 string1string2�
                @�
                  @`� l"+^
$


-- 


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


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