[Cppunit-devel] Problem with configure isfinite/finite detection
Brought to you by:
blep
From: CppUnit d. m. l. <cpp...@li...> - 2007-02-26 08:10:50
|
Compilation of CppUnit currently fails on both Solaris 10 (CC 5.8) & Suse Linux 9.3 (g++ 3.3.5). configure detects either isfinite() or finite(), but compilation fails when attempting to use that function in CppUnit. Below are the relevant part of configure/config-auto and compilation failure message. I don't know how configure detects the presence of those function, but my guess is that it is not done the same way as we compile CppUnit. Linux man page state that isfinite() is only available in standard C99 mode (which does not seem to be combinable with C++). Solaris man page state that finite() requires include of <ieeefp.h>. isfinite() is also present but I guess it is also only when compiling C (did not manage to use it by changing the code). Are the configure tests compiled in C or C++? Here is the relevant data: * Suse Linux 9.3 with g++ 3.3.5: - configure: checking for isfinite... yes checking for finite... yes - config-auto.h matches configure output: /* Define to 1 if you have the `finite' function. */ #ifndef CPPUNIT_HAVE_FINITE #define CPPUNIT_HAVE_FINITE 1 #endif /* define if compiler has isfinite */ #ifndef CPPUNIT_HAVE_ISFINITE #define CPPUNIT_HAVE_ISFINITE 1 #endif - but compilation fails: g++ -DHAVE_CONFIG_H -I. -I../../../src/cppunit -I../../config -I../../include - I../../../include -g -O2 -MT TestAssert.lo -MD -MP -MF .deps/TestAssert.Tpo -c . ./../../src/cppunit/TestAssert.cpp -fPIC -DPIC -o .libs/TestAssert.o In file included from ../../../src/cppunit/TestAssert.cpp:2: ../../../include/cppunit/portability/FloatingPoint.h: In function `bool CppUnit::floatingPointIsFinite(double)': ../../../include/cppunit/portability/FloatingPoint.h:38: error: `isfinite' undeclared (first use this function) ../../../include/cppunit/portability/FloatingPoint.h:38: error: (Each undeclared identifier is reported only once for each function it appears in.) * Solaris 10 (CC 5.8): - configure: checking for isfinite... no checking for finite... yes - config-auto.h matches configure output: /* Define to 1 if you have the `finite' function. */ #ifndef CPPUNIT_HAVE_FINITE #define CPPUNIT_HAVE_FINITE 1 #endif /* define if compiler has isfinite */ /* #undef CPPUNIT_HAVE_ISFINITE */ - but compilation fails: CC -DHAVE_CONFIG_H -I. -I. -I../../config -I../../include -I../../include -pta -mt -xtarget=generic -g -features=no%transitions -xildoff -c TestAssert.cpp -o TestAssert.o "../../include/cppunit/portability/FloatingPoint.h", line 40: Error: The function "finite" must have a prototype. 1 Error(s) detected. Baptiste. --- Baptiste Lepilleur <bl...@us...> CppUnit maintainer OpenTest and CppUnit 2 developer. |