Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11756: boost.Test: non standards compliant use of FE_* macros (unable to compile boost test library on FPU-less arches)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-03-09 12:20:25
#11756: boost.Test: non standards compliant use of FE_* macros (unable to compile
boost test library on FPU-less arches)
----------------------------------+------------------------
Reporter: bartosz.krasinski@⦠| Owner: renficiaud
Type: Patches | Status: reopened
Milestone: Boost 1.64.0 | Component: test
Version: Boost 1.59.0 | Severity: Problem
Resolution: | Keywords:
----------------------------------+------------------------
Comment (by renficiaud):
Ok, now I think I understood the problem:
* the ```feenableexcept/fedisableexcept``` are not standard, those are
``GLIBC`` extensions
* having fenv does not ensure that those 2 functions are in there, for
having those function, we should be ensured that we are indeed compiling
with GLIBC
* however, for anything outside this and SEH based extensions, there is no
easy way to mask floating point exceptions
So, I suggest the following:
* The macro indicating that the floating point exception settings is
supported becomes ```BOOST_TEST_FPE_SUPPORT_WITH_GLIBC_EXTENSIONS__``` and
is defined like this:
{{{
#if defined(BOOST_SEH_BASED_SIGNAL_HANDLING) && !defined(UNDER_CE)
//! Indicates tha the floating point exception handling is supported
//! through SEH
#define BOOST_TEST_FPE_SUPPORT_WITH_SEH__
#elif !defined(BOOST_SEH_BASED_SIGNAL_HANDLING) && !defined(UNDER_CE)
#if !defined(BOOST_NO_FENV_H) && !defined(BOOST_CLANG) && \
(defined(__GLIBC__) && defined(__USE_GNU))
//! Indicates that floating point exception handling is supported for
the
//! non SEH version of it, for the GLIBC extensions only
#define BOOST_TEST_FPE_SUPPORT_WITH_GLIBC_EXTENSIONS__
#endif
#endif
}}}
* the branch taking the ```feenableexcept/fedisableexcept``` is guarded by
this macro
* the branch taking the SEH extension is not affected
* all the rest is falls back to the "unsupported" branch (returning
```BOOST_FPE_OFF/BOOST_FPE_INV```). In particular, I do not see how to
support **3.a** from your comment.
Does this sound correct?
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11756#comment:41> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-03-09 12:24:07 UTC