Opened 11 years ago

Closed 11 years ago

#6156 closed Bugs (fixed)

fenv.hpp broken on clang+glibc

Reported by: Marc Glisse <marc.glisse@…> Owned by: John Maddock
Milestone: To Be Determined Component: math
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc: antoshkka@…

Description

Hello,

with clang and glibc, boost doesn't protect against multiple inclusion of bits/fenv.h:

#include <fenv.h> #include <boost/lexical_cast.hpp>

/localhome/glisse2/include/boost/detail/fenv.hpp:22:11: warning: '_FENV_H' macro redefined /usr/include/fenv.h:24:9: note: previous definition is here /usr/include/x86_64-linux-gnu/bits/fenv.h:30:5: error: redefinition of enumerator 'FE_INVALID' ...

Someone apparently thought it was a good idea to add some subtleties to fenv.hpp to help people who misconfigured clang, but that is imho a bad idea and the special case should be removed (note that clang-3.0 has a good default configuration). If you insist on keeping it, please ensure that _FENV_H is not defined.

Change History (3)

comment:1 by viboes, 11 years ago

Component: Nonelexical_cast
Owner: set to nasonov

comment:2 by Antony Polukhin, 11 years ago

Cc: antoshkka@… added
Component: lexical_castmath
Owner: changed from nasonov to John Maddock

boost/detail/fenv.hpp is not directly included from lexical_cast.hpp Looks like it is a Boost.Math library error:

antoshkka@new:~/boost_maintain/trunk/boost$ grep -r "boost/detail/fenv.hpp" ./
./numeric/interval/detail/c99sub_rounding_control.hpp:#include <boost/detail/fenv.hpp>      // ISO C 99 rounding mode control
./test/execution_monitor.hpp:  #include <boost/detail/fenv.hpp>
./math/tools/config.hpp:   #include <boost/detail/fenv.hpp>

comment:3 by John Maddock, 11 years ago

Resolution: fixed
Status: newclosed

(In [76323]) Fix Clang workaround. Fixes #6156.

Note: See TracTickets for help on using tickets.