This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients mark.dickinson, vstinner
Date 2021-10-08.14:00:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1633701648.12.0.681387521919.issue45412@roundup.psfhosted.org>
In-reply-to
Content
Py_OVERFLOWED() documentation says that the function is not reliable since C99. Python is using C99 since Python 3.6.

/* Py_OVERFLOWED(X)
 * Return 1 iff a libm function overflowed.  Set errno to 0 before calling
 * a libm function, and invoke this macro after, passing the function
 * result.
 * Caution:
 *    This isn't reliable.  C99 no longer requires libm to set errno under
 *        any exceptional condition, but does require +- HUGE_VAL return
 *        values on overflow.  A 754 box *probably* maps HUGE_VAL to a
 *        double infinity, and we're cool if that's so, unless the input
 *        was an infinity and an infinity is the expected result.  A C89
 *        system sets errno to ERANGE, so we check for that too.  We're
 *        out of luck if a C99 754 box doesn't map HUGE_VAL to +Inf, or
 *        if the returned result is a NaN, or if a C89 box returns HUGE_VAL
 *        in non-overflow cases.
 *    X is evaluated more than once.
 * Some platforms have better way to spell this, so expect some #ifdef'ery.
 *
 * OpenBSD uses 'isinf()' because a compiler bug on that platform causes
 * the longer macro version to be mis-compiled. This isn't optimal, and
 * should be removed once a newer compiler is available on that platform.
 * The system that had the failure was running OpenBSD 3.2 on Intel, with
 * gcc 2.95.3.
 *
 * According to Tim's checkin, the FreeBSD systems use isinf() to work
 * around a FPE bug on that platform.
 */
History
Date User Action Args
2021-10-08 14:00:48vstinnersetrecipients: + vstinner, mark.dickinson
2021-10-08 14:00:48vstinnersetmessageid: <1633701648.12.0.681387521919.issue45412@roundup.psfhosted.org>
2021-10-08 14:00:48vstinnerlinkissue45412 messages
2021-10-08 14:00:47vstinnercreate