This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[gfortran] PATCH write with unspecified width for real output (PRlibfortran/18025)
- From: FX Coudert <Francois-Xavier dot Coudert at lcp dot u-psud dot fr>
- To: gcc-patches at gcc dot gnu dot org,GCC Fortran mailing list <fortran at gcc dot gnu dot org>
- Date: Sun, 27 Feb 2005 18:29:15 +0100
- Subject: [gfortran] PATCH write with unspecified width for real output (PRlibfortran/18025)
- Organization: Laboratoire de Chimie Physique
This submitted patch fixes PR libfortran/18025. This is a regression WRT
g77 but is not a bug standardwise.
*strapped and regtested on i686-linux. OK for mainline and 4.0?
2005-02-27 FranÃois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/20101
* write.c (output_float): Make handling of the "F0.d" format
similarly as commercial compilers.
Index: write.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/write.c,v
retrieving revision 1.23
diff -p -u -r1.23 write.c
--- write.c 21 Feb 2005 19:59:58 -0000 1.23
+++ write.c 27 Feb 2005 17:14:02 -0000
@@ -518,7 +534,7 @@ output_float (fnode *f, double value, in
/* Pick a field size if none was specified. */
if (w <= 0)
- w = nbefore + nzero + nafter + 2;
+ w = nbefore + nzero + nafter + (sign != SIGN_NONE ? 2 : 1);
/* Create the ouput buffer. */
out = write_block (w);