#1121: gcc 4.6+ compiler bug for isnan ----------------------+----------------------------------------------------- Reporter: sbrandt | Owner: eschnett Type: defect | Status: new Priority: minor | Milestone: ET_2012_11 Component: Carpet | Version: development version Resolution: | Keywords: ----------------------+-----------------------------------------------------
Comment (by eschnett):
Unfortunately, there are other C++ compilers that do not handle "std::isnan" correctly. Currently, it seems that the idiom {{{ using namespace std; isnan(x); }}} is handled correctly by all compilers I tested. If this is not so, then we will need to introduce an autoconf test for this.
Note also that modern GCC versions always return false from isnan() with -ffast-math (or -Ofast) in C++, but not in C.
Note also that some of isnan's colleagues are not part of older C++ standards.
There are also issues depending on whether <cmath> or <math.h> are included, possibly also depending on their order.