From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15711 invoked by alias); 27 Jul 2005 17:18:34 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 15683 invoked by uid 48); 27 Jul 2005 17:18:29 -0000 Date: Wed, 27 Jul 2005 17:21:00 -0000 From: "grrogers at umd dot edu" To: gcc-bugs@gcc.gnu.org Message-ID: <20050727171825.23097.grrogers@umd.edu> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug fortran/23097] New: non-printable output from write with certain formats X-Bugzilla-Reason: CC X-SW-Source: 2005-07/txt/msg03583.txt.bz2 List-Id: [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