Skip to content

Commit 5e0ea75

Browse files
authored
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.
1 parent 2f90261 commit 5e0ea75

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
On FreeBSD, Python no longer calls ``fedisableexcept()`` at startup to
2+
control the floating point control mode. The call became useless since
3+
FreeBSD 6: it became the default mode.

Modules/main.c

-13
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
#include "pycore_pymem.h"
77
#include "pycore_pystate.h"
88

9-
#ifdef __FreeBSD__
10-
# include <fenv.h> /* fedisableexcept() */
11-
#endif
12-
139
/* Includes for exit_sigint() */
1410
#include <stdio.h> /* perror() */
1511
#ifdef HAVE_SIGNAL_H
@@ -43,15 +39,6 @@ pymain_init(const _PyArgv *args)
4339
return status;
4440
}
4541

46-
/* 754 requires that FP exceptions run in "no stop" mode by default,
47-
* and until C vendors implement C99's ways to control FP exceptions,
48-
* Python requires non-stop mode. Alas, some platforms enable FP
49-
* exceptions by default. Here we disable them.
50-
*/
51-
#ifdef __FreeBSD__
52-
fedisableexcept(FE_OVERFLOW);
53-
#endif
54-
5542
PyPreConfig preconfig;
5643
PyPreConfig_InitPythonConfig(&preconfig);
5744

0 commit comments

Comments
 (0)