[gdal-dev] GDAL 2.2.0 beta 2 available

Sean Gillies sean at mapbox.com
Tue Apr 25 07:05:20 PDT 2017


On Tue, Apr 25, 2017 at 2:44 PM, Even Rouault <even.rouault at spatialys.com>
wrote:

> On mardi 25 avril 2017 14:26:46 CEST Sean Gillies wrote:
>
> > Hi Even,
>
> >
>
> > 2.2.0beta2 fails to build on my macbook. Here is the error:
>
> >
>
> > cpl_conv.cpp:2060:9: error: use of undeclared identifier 'isnan'; did you
>
> > mean 'std::isnan'?
>
> > if( CPLIsNan(dfAngle) )
>
> > ^
>
> > /Users/sean/code/frs-wheel-builds/parts/gdal__compile__/gdal
> -2.2.0/port/cpl_
>
> > port.h:687:23: note: expanded from macro 'CPLIsNan'
>
> > # define CPLIsNan(x) isnan(x)
>
> > ^
>
> > /usr/include/c++/4.2.1/cmath:551:5: note: 'std::isnan' declared here
>
> > isnan(_Tp __f) { return ::__gnu_cxx::__capture_isnan(__f); }
>
> > ^
>
> > 1 error generated.
>
>
>
> Hi Sean,
>
>
>
> ah damned isnan issues...
>
>
>
> Can you try the following patch:
>
>
>
> Index: port/cpl_port.h
>
> ===================================================================
>
> --- port/cpl_port.h (revision 38115)
>
> +++ port/cpl_port.h (working copy)
>
> @@ -653,8 +653,7 @@
>
> # define CPLIsNan(x) _isnan(x)
>
> # define CPLIsInf(x) (!_isnan(x) && !_finite(x))
>
> # define CPLIsFinite(x) _finite(x)
>
> -#elif defined(__cplusplus) && defined(__MINGW32__) && __GNUC__ == 4 &&
> __GNUC_MINOR__ == 2
>
> -/* Hack for compatibility with ancient i586-mingw32msvc toolchain */
>
> +#elif defined(__cplusplus) && ((defined(__MINGW32__) && __GNUC__ == 4 &&
> __GNUC_MINOR__ == 2) || HAVE_CXX11)
>
> extern "C++" {
>
> #include <cmath>
>
> static inline int CPLIsNan(float f) { return std::isnan(f); }
>

That works for cpl_conv.cpp. My next set of failures:

cplstring.cpp:458:26: error: no member named 'back' in 'CPLString'
            if( osNewURL.back() == '&'
                ~~~~~~~~ ^
cplstring.cpp:459:29: error: no member named 'back' in 'CPLString'
                || osNewURL.back() == '?' )
                   ~~~~~~~~ ^
cplstring.cpp:470:23: error: no member named 'back' in 'CPLString'
            if( osURL.back() != '&' && osURL.back() != '?' )
                ~~~~~ ^
cplstring.cpp:470:46: error: no member named 'back' in 'CPLString'
            if( osURL.back() != '&' && osURL.back() != '?' )
                                       ~~~~~ ^
4 errors generated.


This seems to be related to: https://github.com/OSGeo/gdal/commit/
3ed7812f95de1b2d9a6e6bc93717a522df765377. Maybe HAVE_CXX11 isn't
guaranteeing all the expected C++11 features?

-- 
Sean Gillies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170425/09d0a9a0/attachment.html>


More information about the gdal-dev mailing list