[geos-devel] GCC 6 build error
mateusz at loskot.net
Thu Mar 3 01:58:48 PST 2016
On 3 March 2016 at 09:27, Sandro Santilli <strk at keybit.net> wrote:
> On Wed, Mar 02, 2016 at 05:21:33PM +0100, Mateusz Loskot wrote:
>> On 2 March 2016 at 17:13, Sandro Santilli <strk at keybit.net> wrote:
>> > This is the snippet, in configure.ac, to look for it:
>> > AC_LANG_PUSH([C++])
>> > AC_CACHE_CHECK([for isnan], ac_cv_isnan,
>> > [AC_TRY_LINK([#include <cmath>],
>> > [double x; int y; y = isnan(x);],
>> I presume the test fails because it does not look for the function
>> inside std , but assumes nan is in global namespace.
>> I presume, it's especially the case for C++11 compilers.
>>  http://en.cppreference.com/w/cpp/numeric/math/isnan
> I noticed the tests for finite/isfinite include <math.h>
> rather than <cmath>, could that also change the namespacing
> of isnan ?
I'm not sure about GCC extensions thought that might
make isnan or isfinite available as global names
even if C++ #include <cmath> is used,
IOW, #include <cmath> might have the same effect as #include <math.h>.
However, we should be able to rely on that any C++11 compliant toolset
seeing #include <cmath> makes std::nan and std::isfinite available.
Mateusz Loskot, http://mateusz.loskot.net
More information about the geos-devel