This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: RFA: strtod patch
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: RFA: strtod patch
- From: Per Bothner <per at bothner dot com>
- Date: 16 Sep 2001 04:47:11 -0700
- Cc: java at gcc dot gnu dot org
- References: <20010915201859W.mitchell@codesourcery.com>
Mark Mitchell <mark@codesourcery.com> writes:
> It turns out that the C strtod library function used in libjava was
> broken. The code removed by this patch had the effect of causing
> a 0 exponent to result in EINVAL, which does not make sense to me.
The patch looks wrong. The problem is not the error result code,
but some mis-placed braces. Could you try out the following
(which I've only verified that it compiles)?
Index: strtod.c
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/strtod.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 strtod.c
--- strtod.c 1999/04/07 14:52:39 1.1.1.1
+++ strtod.c 2001/09/16 11:37:24
@@ -242,17 +242,17 @@
if (esign)
e = -e;
}
- else
- {
- /* No exponent after an 'E' : that's an error. */
- ptr->_errno = EINVAL;
- e = 0;
- goto ret;
- }
}
else
- s = s00;
+ {
+ /* No exponent after an 'E' : that's an error. */
+ ptr->_errno = EINVAL;
+ e = 0;
+ goto ret;
+ }
}
+ else
+ s = s00;
if (!nd)
{
if (!nz && !nz0)
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/