[Python-checkins] CVS: python/dist/src/Misc NEWS,1.231,1.232

Tim Peters tim_one@users.sourceforge.net
Wed, 05 Sep 2001 15:36:58 -0700

Update of /cvsroot/python/python/dist/src/Misc
In directory usw-pr-cvs1:/tmp/cvs-serv29981/python/Misc

Modified Files:
Log Message:
Rework the way we try to check for libm overflow, given that C99 no longer
requires that errno ever get set, and it looks like glibc is already
playing that game.  New rules:

+ Never use HUGE_VAL.  Use the new Py_HUGE_VAL instead.

+ Never believe errno.  If overflow is the only thing you're interested in,
  use the new Py_OVERFLOWED(x) macro.  If you're interested in any libm
  errors, use the new Py_SET_ERANGE_IF_OVERFLOW(x) macro, which attempts
  to set errno the way C89 said it worked.

Unfortunately, none of these are reliable, but they work on Windows and I
*expect* under glibc too.

Index: NEWS
RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v
retrieving revision 1.231
retrieving revision 1.232
diff -C2 -d -r1.231 -r1.232
*** NEWS	2001/09/05 18:43:35	1.231
--- NEWS	2001/09/05 22:36:56	1.232
*** 82,85 ****
--- 82,92 ----
+ - The new C standard no longer requires that math libraries set errno to
+   ERANGE on overflow.  For platform libraries that exploit this new
+   freedom, Python's overflow-checking was wholly broken.  A new overflow-
+   checking scheme attempts to repair that, but may not be reliable on all
+   platforms (C doesn't seem to provide anything both useful and portable
+   in this area anymore).
  - Asynchronous timeout actions are available through the new class