Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#784 closed defect (fixed)

g++ 6 isnan issues

Reported by: rsbivand Owned by: geos-devel@…
Priority: blocker Milestone: 3.5.1
Component: Default Version: 3.5.0
Severity: Unassigned Keywords:
Cc:

Description

Further to https://lists.osgeo.org/pipermail/geos-devel/2016-March/007433.html, and success with the suggested patch for 3.5.0 for some of the make, on Fedora 24, g++ 6.1.1 20160621, I see later on, in tests/xmltester:

g++ -DHAVE_CONFIG_H -I. -I../../include -I../../include/geos  -I../../include -I../../src/io/tinyxml -DTIXML_USE_STL  -DGEOS_INLINE -g -O2 -MT XMLTester-XMLTester.o -MD -MP -MF .deps/XMLTester-XMLTester.Tpo -c -o XMLTester-XMLTester.o `test -f 'XMLTester.cpp' || echo './'`XMLTester.cpp
In file included from ../../include/geos/geom/Point.h:25:0,
                 from XMLTester.cpp:27:
../../include/geos/geom/Coordinate.inl: In member function ‘bool geos::geom::Coordinate::isNull() const’:
../../include/geos/platform.h:90:27: error: ‘isnan’ was not declared in this scope
 # define ISNAN(x) (isnan(x))
                           ^
../../include/geos/geom/Coordinate.inl:38:10: note: in expansion of macro ‘ISNAN’
  return (ISNAN(x) && ISNAN(y) && ISNAN(z));
          ^~~~~
../../include/geos/platform.h:90:27: note: suggested alternative:
 # define ISNAN(x) (isnan(x))
                           ^
../../include/geos/geom/Coordinate.inl:38:10: note: in expansion of macro ‘ISNAN’
  return (ISNAN(x) && ISNAN(y) && ISNAN(z));
          ^~~~~
In file included from ../../include/geos/geom/Coordinate.inl:22:0,
                 from ../../include/geos/geom/Coordinate.h:158,
                 from ../../include/geos/geom/Envelope.h:25,
                 from ../../include/geos/geom/Geometry.h:27,
                 from ../../include/geos/geom/Point.h:26,
                 from XMLTester.cpp:27:
/usr/include/c++/6.1.1/cmath:655:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^~~~~

This means that 3.5.0 cannot be built on Fedora 24 without further changes to configure.ac, and possibly elsewhere, to pass through the settings seen earlier in the make process.

Attachments (1)

gcc6-isnan.patch (481 bytes ) - added by Bas Couwenberg 8 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 by rsbivand, 8 years ago

Priority: majorblocker

comment:2 by rsbivand, 8 years ago

Work-around by setting:

export CXX="g++ -std=c++98"

before running ./configure (without the patch, from the release tarball).

comment:3 by Bas Couwenberg, 8 years ago

The GCC 6 isnan issue is causing a Release Critical bug in the geos Debian package too, Debian Bug #831177 reported by Lucas Nussbaum.

It looks like the std::isnan change from r4169 also needs to be applied to include/geos/platform.h.in to use that instead of plain isnan. attachment:gcc6-isnan.patch fixes this issue for the Debian package with GCC 6.1.1 from Debian unstable (in addition to the change from r4169).

by Bas Couwenberg, 8 years ago

Attachment: gcc6-isnan.patch added

comment:4 by strk, 8 years ago

Resolution: fixed
Status: newclosed

In 4224:

Fully qualify isnan call when HAVE_ISNAN is defined

Fixes build with GCC-5.3.0 and higher.
Closes #784

comment:5 by strk, 8 years ago

In 4225:

Look for isnan in std:: namespace

Fully qualify isnan call when HAVE_ISNAN is defined
Tested with gcc 4.8.4

Fixes build with GCC-5.3.0 and higher.
Closes #784

comment:6 by strk, 8 years ago

In 4227:

Look for isnan in std:: namespace

Fully qualify isnan call when HAVE_ISNAN is defined
Tested with gcc 4.8.4

Fixes build with GCC-5.3.0 and higher.
Closes #784

comment:7 by strk, 8 years ago

In 4229:

Look for isnan in std:: namespace

Fully qualify isnan call when HAVE_ISNAN is defined
Tested with gcc 4.8.4

Fixes build with GCC-5.3.0 and higher.
Closes #784

comment:8 by rsbivand, 8 years ago

Confirmed resolved for Fedora 24, and #4229, GEOS builds cleanly, and rgeos builds and checks as expected. Thanks for fixing this!

comment:9 by Sandro Santilli <strk@…>, 7 years ago

In a9bb3ed/git:

Fully qualify isnan call when HAVE_ISNAN is defined

Fixes build with GCC-5.3.0 and higher.
Closes #784

git-svn-id: http://svn.osgeo.org/geos/trunk@4224 5242fede-7e19-0410-aef8-94bd7d2200fb

comment:10 by Sandro Santilli <strk@…>, 7 years ago

In a9bb3ed/git:

Fully qualify isnan call when HAVE_ISNAN is defined

Fixes build with GCC-5.3.0 and higher.
Closes #784

git-svn-id: http://svn.osgeo.org/geos/trunk@4224 5242fede-7e19-0410-aef8-94bd7d2200fb

comment:11 by Sandro Santilli <strk@…>, 7 years ago

In a9bb3ed/git:

Fully qualify isnan call when HAVE_ISNAN is defined

Fixes build with GCC-5.3.0 and higher.
Closes #784

git-svn-id: http://svn.osgeo.org/geos/trunk@4224 5242fede-7e19-0410-aef8-94bd7d2200fb

Note: See TracTickets for help on using tickets.