https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81542
Bug ID: 81542
Summary: Compilation failure with math.h and
-D_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
Product: gcc
Version: 6.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gmc at synopsys dot com
Target Milestone: ---
There appears to be a problem with the math.h file created by GCC, starting
with GCC version 6.x
Create testfile "test.cxx" which contains ONLY the one line:
#include <math.h>
and compile it as
g++ -D_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC test.cxx -c
With GCC versions up to GCC 5.4 this works fine ; with GCC 6.1 -> 6.4 and 7.1
we get a compilation failure:
/remote/srm692/gmc/Gnu/GCC_6.2.0/include/c++/6.2.0/math.h:63:12: error:
'std::fpclassify' has not been declared
using std::fpclassify;
^~~~~~~~~~
... etc. (as above, for each of: isfinite, isinf, isnan, isnormal, signbit,
isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered)
Looking at include file cmath from GCC 6.x, there are TWO conditions that must
be satisfied before we have definitions for fpclassify, isnan, etc... :
542 #if _GLIBCXX_USE_C99_MATH
543 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
whereas in math.h there is only a single condition:
62 #if _GLIBCXX_USE_C99_MATH
Shouldn't the above math.h content match cmath in having the second
(!_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC) condition added ?
Thanks,
Gordon