[ET Trac] [Einstein Toolkit] #1121: gcc 4.6+ compiler bug for isnan

Einstein Toolkit trac-noreply at einsteintoolkit.org
Mon Oct 15 11:34:51 CDT 2012


#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.

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/1121#comment:2>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list