2
0
mirror of https://github.com/boostorg/test.git synced 2026-01-27 19:32:11 +00:00
Files
test/include
André Draszik eec86d1fbe trac 11756: fix usage of floating point exception macros
A fully standards conforming fenv.h does not have to define any FE_* macros, and if it does define them,
then it defines macros only for the FP exceptions it actually supports.

Correct usage requires a triple check:
1) Check BOOST_NO_FENV_H to see if the header is supported.
2) Include the header and then check FE_ALL_EXCEPT to see
   if any FP exceptions are supported.
3) Before using the individual FE_* macros, you need to
   check for their existence too as not all may be
   supported.

The reason is that some (notably FPU-less) architectures,
including mips*-nf, don't define/implement some of the
floating point constants, even though fenv.h is
available.

Other projects have similar issues, e.g. pixman, and apply similar work-arounds:
https://lists.freedesktop.org/archives/pixman/2014-February/003172.html

Architectures are notably also allowed to define FE_ALL_EXCEPT to 0!
Keeping this in mind, and knowing that the compiler will eliminate
code that can't be executed, we can change BOOST_FPE_ALL to be 0 for
the case of compiling using Clang and/or fenv.h being unavailable
as well, which allows simplification of the #ifdef's in
execution_monitor.ipp a bit.
2016-10-18 23:35:15 +02:00
..