RFA: strtod patch

Per Bothner per@bothner.com
Sun Sep 16 04:47:00 GMT 2001


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/


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /