This is the mail archive of the gcc-patches@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]

[gfortran, patch] PR libfortran/19155


Last corner case of PR libfortran/19155, which still failed on AIX. We
relied on strtod returning either 0 or ERANGE, but it can return
EINVAL too. In that case (it happens when we it is passed an empty
string), we should proceed and not issue an error.

This is a very simple patch, regtested on i686-linux. OK for mainline
and 4.0? (I must admit I was tempted to commit this one as obvious)
Index: libgfortran/ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/ChangeLog,v
retrieving revision 1.163.2.54
diff -u -3 -p -r1.163.2.54 ChangeLog
--- libgfortran/ChangeLog       16 Jun 2005 23:00:38 -0000      1.163.2.54
+++ libgfortran/ChangeLog       17 Jun 2005 15:35:26 -0000
@@ -1,3 +1,9 @@
+2005-06-18  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/19155
+       * io/read.c (convert_real): strtod can set errno to EINVAL on an
+       empty string, but we shouldn't have an error in that case.
+
 2005-06-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 
        PR libfortran/19216
cvs diff: Diffing libgfortran/generated
cvs diff: Diffing libgfortran/intrinsics
cvs diff: Diffing libgfortran/io
Index: libgfortran/io/read.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/io/read.c,v
retrieving revision 1.8.10.2
diff -u -3 -p -r1.8.10.2 read.c
--- libgfortran/io/read.c       16 Jun 2005 22:39:10 -0000      1.8.10.2
+++ libgfortran/io/read.c       17 Jun 2005 15:35:26 -0000
@@ -122,7 +122,7 @@ convert_real (void *dest, const char *bu
       internal_error ("Unsupported real kind during IO");
     }
 
-  if (errno != 0)
+  if (errno != 0 && errno != EINVAL)
     {
       generate_error (ERROR_READ_VALUE,
                      "Range error during floating point read");

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