This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/23097] New: non-printable output from write with certain formats
- From: "grrogers at umd dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jul 2005 17:18:29 -0000
- Subject: [Bug fortran/23097] New: non-printable output from write with certain formats
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
[casper@ARROW test_blas]$ ~/GREG/bin_gcc/bin/gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc4/configure --prefix=/home/casper/GREG/bin_gcc --
mandir=/home/casper/GREG/objdir/share/man --enable-
languages=c,c++,f95,java,objc --enable-shared --enable-threads=posix --with-
mpfr=/home/casper/GREG/f90_prereq --with-gmp=/home/casper/GREG/f90_prereq :
(reconfigured) ../gcc4/configure --prefix=/home/casper/GREG/bin_gcc --enable-
threads --with-gmp=/home/casper/GREG/f90_prereq --with-
mpfr=/home/casper/GREG/f90_prereq
Thread model: posix
gcc version 4.1.0 20050719 (experimental)
[casper@ARROW test_blas]$ uname -a
Linux ARROW 2.4.20-8bigmem #1 SMP Thu Mar 13 17:32:29 EST 2003 i686 i686 i386
GNU/Linux
[casper@ARROW test_blas]$ cat test_io.f90
PROGRAM TEST_IO
INTEGER :: A = 12, B = 109
! actual data not important
WRITE(*,100)A,B
WRITE(*,101)A,B
100 FORMAT(/,2X,I5,/2X,I5)
101 FORMAT(2(/,3X,I5))
END PROGRAM TEST_IO
[casper@ARROW test_blas]$ ~/GREG/bin_gcc/bin/gfortran test_io.f90 -static
[casper@ARROW test_blas]$ ./a.out
12
109
12
109
-----------------------------------------------------------------
As you can see this is the expected normal behavior, but if you redirect the
output by either piping to something like less, or to a file then editing with
say:
[casper@ARROW test_blas]$ ./a.out > junk; vi junk
the file becomes:
12
^@^@ 109
12
^@^@^@ 109
------------------------------------------------------------------
the ^@ characters are supposed to be the blanks that the #X outputs. As you
can see it prints some odd character instead. This only happens after you
make a newline with /, otherwise it works as normal. If you have a single
format statement with multiple /2X statements like format 101 above, the first
one works correctly, all others after this exibit the bug.
--
Summary: non-printable output from write with certain formats
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: grrogers at umd dot edu
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23097