[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-46670: "Build Python with -Wundef: don't use undefined macros". -- ___ Python tracker ___

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset 9bbdde218005f552304d9954bb97e3f9185edded by Victor Stinner in branch 'main': bpo-45412: Add _PY_SHORT_FLOAT_REPR macro (GH-31171) https://github.com/python/cpython/commit/9bbdde218005f552304d9954bb97e3f9185edded --

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29343 pull_request: https://github.com/python/cpython/pull/31171 ___ Python tracker ___

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-11 Thread STINNER Victor
STINNER Victor added the comment: Include/pymath.h is now better, I close the issue ;-) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-11 Thread STINNER Victor
STINNER Victor added the comment: New changeset 61190e092b8258ede92ac543bb39bad0f7168104 by Victor Stinner in branch 'main': bpo-45412: Move copysign() define to pycore_pymath.h (GH-28889) https://github.com/python/cpython/commit/61190e092b8258ede92ac543bb39bad0f7168104 --

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-11 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +27184 pull_request: https://github.com/python/cpython/pull/28889 ___ Python tracker ___

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-11 Thread STINNER Victor
STINNER Victor added the comment: New changeset 7103356455c8b0c2ba3523929327756413337a31 by Victor Stinner in branch 'main': bpo-45412: Move _Py_SET_53BIT_PRECISION_START to pycore_pymath.h (GH-28882) https://github.com/python/cpython/commit/7103356455c8b0c2ba3523929327756413337a31

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-11 Thread STINNER Victor
STINNER Victor added the comment: New changeset a9fe1a8e5b4698937e06c2c419da92e6f78f2ee7 by Victor Stinner in branch 'main': bpo-45412: Update _Py_ADJUST_ERANGE1() comment (GH-28884) https://github.com/python/cpython/commit/a9fe1a8e5b4698937e06c2c419da92e6f78f2ee7 --

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-11 Thread STINNER Victor
STINNER Victor added the comment: > *This isn't reliable. See Py_OVERFLOWED comments. Oops, Py_OVERFLOWED() has been removed: I created PR 28884 to fix the comment. -- ___ Python tracker

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-11 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +27178 pull_request: https://github.com/python/cpython/pull/28884 ___ Python tracker ___

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-11 Thread STINNER Victor
STINNER Victor added the comment: > +1 for the removals. (We should fix #44970 too, but as you say that's a > separate issue. And I suspect that the Py_ADJUST_ERANGE1() use for float pow > should be replaced, too.) Well, it's scary of use functions which are documented as: * Caution: *

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-11 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +27177 pull_request: https://github.com/python/cpython/pull/28882 ___ Python tracker ___

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-11 Thread STINNER Victor
STINNER Victor added the comment: New changeset 2f92e2a590f0e5d2d3093549f5af9a4a1889eb5a by Victor Stinner in branch 'main': bpo-45412: Remove Py_SET_ERRNO_ON_MATH_ERROR() macro (GH-28820) https://github.com/python/cpython/commit/2f92e2a590f0e5d2d3093549f5af9a4a1889eb5a --

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-11 Thread Mark Dickinson
Mark Dickinson added the comment: +1 for the removals. (We should fix #44970 too, but as you say that's a separate issue. And I suspect that the Py_ADJUST_ERANGE1() use for float pow should be replaced, too.) -- ___ Python tracker

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-09 Thread STINNER Victor
STINNER Victor added the comment: > And I have doubts about Py_ADJUST_ERANGE2(). I think that it is used > incorrectly. See issue44970. The question here is if it should be exported in the C API. I propose to remove it. Fixing it is a different issue: bpo-44970 :-) --

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And I have doubts about Py_ADJUST_ERANGE2(). I think that it is used incorrectly. See issue44970. -- nosy: +serhiy.storchaka ___ Python tracker

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-08 Thread STINNER Victor
STINNER Victor added the comment: I add Mark Dickinson and Tim Peters who were involved in changes removing usage of these macros. -- nosy: +tim.peters ___ Python tracker

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-08 Thread STINNER Victor
STINNER Victor added the comment: Py_ADJUST_ERANGE1() is used by float ** float. Py_ADJUST_ERANGE2() is used by complex ** complex. -- ___ Python tracker ___

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-08 Thread STINNER Victor
STINNER Victor added the comment: Py_SET_ERRNO_ON_MATH_ERROR() documentation also says that it is not reliable: /* Py_SET_ERRNO_ON_MATH_ERROR(x) * If a libm function did not set errno, but it looks like the result * overflowed or not-a-number, set errno to ERANGE or EDOM. Set errno * to 0

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-08 Thread STINNER Victor
STINNER Victor added the comment: 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

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-08 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-08 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +27139 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28820 ___ Python tracker ___

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-08 Thread STINNER Victor
New submission from STINNER Victor : I propose to remove the following macros from the Python C API: * Py_OVERFLOWED() * _Py_SET_EDOM_FOR_NAN() * Py_SET_ERRNO_ON_MATH_ERROR() * Py_SET_ERANGE_IF_OVERFLOW() * Py_ADJUST_ERANGE1() * Py_ADJUST_ERANGE2() Only Py_ADJUST_ERANGE1() and