re PR libfortran/18025 (libgfortran: format, incompatible "minimum width" edit descri...
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>
Wed, 23 Mar 2005 21:42:10 +0000 (22:42 +0100)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Wed, 23 Mar 2005 21:42:10 +0000 (21:42 +0000)
        PR libfortran/18025
        * write.c (output_float): Handling the "F0.d" format similarly as
        commercial compilers.

        * pr18025.f90: New test.

From-SVN: r96953

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr18025.f90 [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/io/write.c

index 84a73de..465d516 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-23  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * pr18025.f90: New test.
+
 2005-03-23  Dale Johannesen  <dalej@apple.com>
        
        * gcc.dg/20020312-2.c:  Fix for non-PowerPC Darwin.
diff --git a/gcc/testsuite/gfortran.dg/pr18025.f90 b/gcc/testsuite/gfortran.dg/pr18025.f90
new file mode 100644 (file)
index 0000000..69a6af6
--- /dev/null
@@ -0,0 +1,8 @@
+! PR libfortran/18025  <coudert@clipper.ens.fr>
+! {dg-do run}
+  character(len=80) :: c
+  write(c, "('#',F0.2,'#')") 1.23
+  if (c /= '#1.23#') call abort
+  write(c, "('#',F0.2,'#')") -1.23
+  if (c /= '#-1.23#') call abort
+  end
index c32ca52..a3964b7 100644 (file)
@@ -1,3 +1,9 @@
+2005-02-27 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+       PR libfortran/18025
+       * write.c (output_float): Handling the "F0.d" format similarly as
+       commercial compilers.
+
 2005-03-22  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 
        * Makefile.am: Added new files.
index 88e5280..d22aa34 100644 (file)
@@ -537,7 +537,7 @@ output_float (fnode *f, double value, int len)
 
   /* 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);