[postgis-tickets] [PostGIS] #3906: casting const to non-const

PostGIS trac at osgeo.org
Tue Oct 17 06:22:58 PDT 2017


#3906: casting const to non-const
---------------------+---------------------------
 Reporter:  pramsey  |      Owner:  komzpa
     Type:  defect   |     Status:  assigned
 Priority:  high     |  Milestone:  PostGIS 2.4.1
Component:  postgis  |    Version:  2.4.x
 Keywords:           |
---------------------+---------------------------
 This warning is showing up in our stable branch, which gives me the
 willies. Can we have the clean solution ported back from trunk please?
 {{{
 lwgeom_geos.c:277:8: warning: assigning to 'POINTARRAY *' from 'const
 POINTARRAY *' discards qualifiers
       [-Wincompatible-pointer-types-discards-qualifiers]
                         npa = pa;
                             ^ ~~
 lwgeom_geos.c:282:25: warning: passing 'const POINTARRAY *' to parameter
 of type 'POINTARRAY *' discards
       qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                         ptarray_append_point(pa, getPoint_internal(pa, 0),
 LW_TRUE);
                                              ^~
 ./liblwgeom.h:906:45: note: passing argument to parameter 'pa' here
 extern int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int
 allow_duplicates);
                                             ^
 lwgeom_geos.c:282:29: warning: incompatible pointer types passing 'uint8_t
 *' (aka 'unsigned char *') to
       parameter of type 'const POINT4D *' [-Wincompatible-pointer-types]
                         ptarray_append_point(pa, getPoint_internal(pa, 0),
 LW_TRUE);
                                                  ^~~~~~~~~~~~~~~~~~~~~~~~
 }}}

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3906>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list