diff --git a/src/doc/manual/user-guide/embedding.txi b/src/doc/manual/user-guide/embedding.txi index 0caec4d5..ac0fd0c8 100644 --- a/src/doc/manual/user-guide/embedding.txi +++ b/src/doc/manual/user-guide/embedding.txi @@ -258,8 +258,7 @@ booting. This macro allows for execution of Lisp code while saving and later restoring the floating point environment of surrounding C code so that changes in the floating point environment don't leak outside. -@coderef{ECL_WITH_LISP_FPE} can be also used before ECL has booted or -before an external thread has been imported. +@coderef{ECL_WITH_LISP_FPE} can be also used before ECL has booted. @exindex Safely executing Lisp code with floating point exceptions in embedding program @paragraph Example diff --git a/src/h/impl/math_fenv.h b/src/h/impl/math_fenv.h index 9630f4c6..ea13d87b 100644 --- a/src/h/impl/math_fenv.h +++ b/src/h/impl/math_fenv.h @@ -75,12 +75,12 @@ # define ECL_WITH_LISP_FPE_BEGIN do { \ fenv_t __fenv; \ fegetenv(&__fenv); \ + feclearexcept(FE_ALL_EXCEPT); \ if (ecl_get_option(ECL_OPT_BOOTED) > 0) { \ int bits = ecl_process_env()->trap_fpe_bits; \ fedisableexcept(FE_ALL_EXCEPT & ~bits); \ feenableexcept(FE_ALL_EXCEPT & bits); \ - } \ - feclearexcept(FE_ALL_EXCEPT); + } # else # define ECL_WITH_LISP_FPE_BEGIN do { \ fenv_t __fenv; \