[Python-bugs-list] [ python-Bugs-815062 ] Py_OVERFLOWED should be
isinf() on openbsd
SourceForge.net
noreply at sourceforge.net
Tue Sep 30 09:09:37 EDT 2003
Bugs item #815062, was opened at 2003-09-30 13:09
Message generated for change (Comment added) made by mwh
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=815062&group_id=5470
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Anthony Baxter (anthonybaxter)
Assigned to: Nobody/Anonymous (nobody)
Summary: Py_OVERFLOWED should be isinf() on openbsd
Initial Comment:
test_long and test_complex both fail on OpenBSD/x86.
The problem is essentially that:
>>> shuge = '12345' * 120
>>> float(int(shuge))
Inf
while on everything else, this raises an OverflowError.
Making the #ifdef in Include/pyport.h that sets
Py_OVERFLOWED to isinf() also do the same for OpenBSD
fixes this. I'm proposing to fix this for 2.3.2,
because then we're passing all tests on openbsd (minus
the wackiness from the HP testdrive boxes).
Tim, is there any reason to not add an autoconf test
for the presence of isinf(), and always use it for
Py_OVERFLOWED if it's present? Using it on this Redhat
9 system doesn't seem to break anything (well, the test
suite passes).
Obviously not going to make the latter change for
2.3.2, but is it appropriate for the trunk?
----------------------------------------------------------------------
>Comment By: Michael Hudson (mwh)
Date: 2003-09-30 14:09
Message:
Logged In: YES
user_id=6656
it's compiler bogusness, it seems, unless the code in
PyLong_AsDouble is non-ansi in some way that currently
escapes the eye. compiling -O2 or higher makes test_long
fail; -O or lower makes it pass.
gcc is 2.95.3 fwiw.
----------------------------------------------------------------------
Comment By: Michael Hudson (mwh)
Date: 2003-09-30 13:41
Message:
Logged In: YES
user_id=6656
while setting Py_OVERFLOWED to use isinf does indeed make
the tests pass on openbad, i'd be happier if i understood
why the other definition *doesn't* work...
----------------------------------------------------------------------
Comment By: Anthony Baxter (anthonybaxter)
Date: 2003-09-30 13:23
Message:
Logged In: YES
user_id=29957
--- pyport.h 4 Sep 2003 11:59:50 -0000 2.63
+++ pyport.h 30 Sep 2003 12:22:14 -0000
@@ -258,7 +258,7 @@
* X is evaluated more than once.
* Some platforms have better way to spell this, so expect
some #ifdef'ery.
*/
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
#define Py_OVERFLOWED(X) isinf(X)
#else
makes test_long and test_complex pass on OpenBSD.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=815062&group_id=5470
More information about the Python-bugs-list
mailing list