This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran, patch] PR libfortran/19155
- From: François-Xavier Coudert <fxcoudert at gmail dot com>
- To: gfortran <fortran at gcc dot gnu dot org>, patch <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 17 Jun 2005 17:39:03 +0200
- Subject: [gfortran, patch] PR libfortran/19155
- Reply-to: François-Xavier Coudert <fxcoudert at gmail dot com>
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");