[GEOS] #785: g++ 6 auto_ptr

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[GEOS] #785: g++ 6 auto_ptr

geos-2
#785: g++ 6 auto_ptr
------------------------+--------------------------
 Reporter:  rsbivand    |      Owner:  geos-devel@…
     Type:  defect      |     Status:  new
 Priority:  minor       |  Milestone:  3.5.1
Component:  Default     |    Version:  3.5.0
 Severity:  Unassigned  |   Keywords:
------------------------+--------------------------
 The use of auto_ptr throws warnings in g++ 6 in Fedora 24, chiefly in
 XMLTester:

 {{{
 In file included from ../../include/geos/geom/Geometry.h:27:0,
                  from ../../include/geos/geom/Point.h:26,
                  from XMLTester.cpp:27:
 ../../include/geos/geom/Envelope.h: At global scope:
 ../../include/geos/geom/Envelope.h:57:15: warning: ‘template<class> class
 std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
   typedef std::auto_ptr<Envelope> AutoPtr;
                ^~~~~~~~
 In file included from /usr/include/c++/6.1.1/memory:81:0,
                  from ../../include/geos/geom/Envelope.h:29,
                  from ../../include/geos/geom/Geometry.h:27,
                  from ../../include/geos/geom/Point.h:26,
                  from XMLTester.cpp:27:
 /usr/include/c++/6.1.1/bits/unique_ptr.h:49:28: note: declared here
    template<typename> class auto_ptr;
                             ^~~~~~~~
 }}}

 There are other wanings for other types of -W, such as the following, so
 it looks as though g++ 6 is stricter in checking:

 {{{
 WKTWriter.cpp: In member function ‘void
 geos::io::WKTWriter::appendPointTaggedText(const geos::geom::Coordinate*,
 int, geos::io::Writer*)’:
 WKTWriter.cpp:239:5: warning: this ‘if’ clause does not guard...
 [-Wmisleading-indentation]
      if( outputDimension == 3 && !old3D && coordinate != NULL )
      ^~
 WKTWriter.cpp:242:2: note: ...this statement, but the latter is
 misleadingly indented as if it is guarded by the ‘if’
   appendPointText(coordinate, level, writer);
   ^~~~~~~~~~~~~~~
 }}}

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/785>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).
_______________________________________________
geos-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #785: g++ 6 auto_ptr

geos-2
#785: g++ 6 auto_ptr
------------------------+---------------------------
 Reporter:  rsbivand    |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  minor       |   Milestone:  3.5.1
Component:  Default     |     Version:  3.5.0
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by strk):

 I'm afraid we are not ready to deprecate auto_ptr yet.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/785#comment:1>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).
_______________________________________________
geos-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #785: g++ 6 auto_ptr

geos-2
In reply to this post by geos-2
#785: g++ 6 auto_ptr
------------------------+---------------------------
 Reporter:  rsbivand    |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  minor       |   Milestone:  3.5.1
Component:  Default     |     Version:  3.5.0
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by rouault):

 auto_ptr and unique_ptr have very similar behaviour and API and can be
 used equivalently if you make basic uses of them (check the differences to
 see if you're not running into them)

 In GDAL there's a driver making use of auto_ptr, and I've finally done
 {{{
 #if __cplusplus >= 201103L
 #define UNIQUEPTR       std::unique_ptr
 #else
 #define UNIQUEPTR       std::auto_ptr
 #endif
 }}}

 A bit ugly, but works fine.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/785#comment:2>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).
_______________________________________________
geos-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #785: g++ 6 auto_ptr

geos-2
In reply to this post by geos-2
#785: g++ 6 auto_ptr
------------------------+---------------------------
 Reporter:  rsbivand    |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  minor       |   Milestone:  3.5.1
Component:  Default     |     Version:  3.5.0
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by mloskot):

 Replying to [comment:2 rouault]:
 > In GDAL there's a driver making use of auto_ptr, and I've finally done
 > {{{
 > #if __cplusplus >= 201103L
 > #define UNIQUEPTR       std::unique_ptr
 > #else
 > #define UNIQUEPTR       std::auto_ptr
 > #endif
 > }}}


 For sake, typedef!

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/785#comment:3>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).
_______________________________________________
geos-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #785: g++ 6 auto_ptr

geos-2
In reply to this post by geos-2
#785: g++ 6 auto_ptr
------------------------+---------------------------
 Reporter:  rsbivand    |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  minor       |   Milestone:  3.5.1
Component:  Default     |     Version:  3.5.0
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by strk):

 An uniqueptr typedef sounds like a good idea. Patches welcome !

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/785#comment:4>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).
_______________________________________________
geos-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #785: g++ 6 auto_ptr

geos-2
In reply to this post by geos-2
#785: g++ 6 auto_ptr
------------------------+---------------------------
 Reporter:  rsbivand    |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  minor       |   Milestone:  3.5.1
Component:  Default     |     Version:  3.5.0
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by mloskot):

 I'd rather leave it as it is and wait until we can switch to c++0x/11
 compilers and to `std::unique_ptr` only.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/785#comment:5>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).
_______________________________________________
geos-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #785: g++ 6 auto_ptr

geos-2
In reply to this post by geos-2
#785: g++ 6 auto_ptr
------------------------+---------------------------
 Reporter:  rsbivand    |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  minor       |   Milestone:  3.8.0
Component:  Default     |     Version:  3.5.0
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------
Changes (by robe):

 * milestone:  3.5.2 => 3.8.0


--
Ticket URL: <https://trac.osgeo.org/geos/ticket/785#comment:7>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #785: g++ 6 auto_ptr

geos-2
In reply to this post by geos-2
#785: g++ 6 auto_ptr
------------------------+---------------------------
 Reporter:  rsbivand    |       Owner:  geos-devel@…
     Type:  defect      |      Status:  closed
 Priority:  minor       |   Milestone:  3.8.0
Component:  Default     |     Version:  3.5.0
 Severity:  Unassigned  |  Resolution:  wontfix
 Keywords:              |
------------------------+---------------------------
Changes (by dbaston):

 * status:  new => closed
 * resolution:   => wontfix


Comment:

 I think this can be considered closed now that current GEOS uses C++11,
 and we aren't going to backport C++11 features into stable branches.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/785#comment:8>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel