Project

General

Profile

[SOLVED] Compile Error : compare.h:34:30: error: non-floating-point argument

Added by Kivanc KARANIS over 6 years ago

compiling cdo-1.9.1rc3 with gcc5.3.0 failed as below (7.2.0 didn`t complain and completed compiling)

g++ -std=gnu++11 -DHAVE_CONFIG_H -I.  -I../libcdi/src -I/opt/szip/include  -I/usr/include/libxml2  -march=haswell -O3 -fopenmp  -MT cdo-EstFreq.o -MD -MP -MF .deps/cdo-EstFreq.Tpo -c -o cdo-EstFreq.o `test -f 'EstFreq.cc' || echo './'`EstFreq.cc
In file included from cdo_int.h:30:0,
                 from EstFreq.cc:20:
EstFreq.cc: In function 'void* EstFreq(void*)':
compare.h:34:30: error: non-floating-point argument in call to function '__builtin_isnan'
 #  define DBL_IS_NAN(x)     (isnan(x))
                              ^
compare.h:46:45: note: in expansion of macro 'DBL_IS_NAN'
 #  define DBL_IS_EQUAL(x,y) (DBL_IS_NAN(x)||DBL_IS_NAN(y)?(DBL_IS_NAN(x)&&DBL_IS_NAN(y)?1:0):!(x < y || y < x))

Change in line 34: (isnan(x)) to (( x) != (x)) produced output

-- define DBL_IS_NAN(x)     (isnan(x))
++ define DBL_IS_NAN(x)     ((x) != (x))

Replies (1)

RE: [SOLVED] Compile Error : compare.h:34:30: error: non-floating-point argument - Added by Uwe Schulzweida over 6 years ago

Thanks, we will fix this problem in the next CDO release!

    (1-1/1)