From 5e0ea7540f577c9684e272000fdfc80d29bb78a2 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 1 Oct 2019 13:12:29 +0200 Subject: [PATCH] bpo-37474: Don't call fedisableexcept() on FreeBSD (GH-16515) On FreeBSD, Python no longer calls fedisableexcept() at startup to control the floating point control mode. The call became useless since FreeBSD 6: it became the default mode. --- .../2019-10-01-12-46-30.bpo-37474.cB3se1.rst | 3 +++ Modules/main.c | 13 ------------- 2 files changed, 3 insertions(+), 13 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2019-10-01-12-46-30.bpo-37474.cB3se1.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-10-01-12-46-30.bpo-37474.cB3se1.rst b/Misc/NEWS.d/next/Core and Builtins/2019-10-01-12-46-30.bpo-37474.cB3se1.rst new file mode 100644 index 00000000000..c259f81a3d7 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2019-10-01-12-46-30.bpo-37474.cB3se1.rst @@ -0,0 +1,3 @@ +On FreeBSD, Python no longer calls ``fedisableexcept()`` at startup to +control the floating point control mode. The call became useless since +FreeBSD 6: it became the default mode. diff --git a/Modules/main.c b/Modules/main.c index 526b0ade84a..929417fe775 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -6,10 +6,6 @@ #include "pycore_pymem.h" #include "pycore_pystate.h" -#ifdef __FreeBSD__ -# include /* fedisableexcept() */ -#endif - /* Includes for exit_sigint() */ #include /* perror() */ #ifdef HAVE_SIGNAL_H @@ -43,15 +39,6 @@ pymain_init(const _PyArgv *args) return status; } - /* 754 requires that FP exceptions run in "no stop" mode by default, - * and until C vendors implement C99's ways to control FP exceptions, - * Python requires non-stop mode. Alas, some platforms enable FP - * exceptions by default. Here we disable them. - */ -#ifdef __FreeBSD__ - fedisableexcept(FE_OVERFLOW); -#endif - PyPreConfig preconfig; PyPreConfig_InitPythonConfig(&preconfig);