Opened 2 years ago

Closed 2 years ago

#3906 closed defect (fixed)

casting const to non-const

Reported by: pramsey Owned by: komzpa
Priority: high Milestone: PostGIS 2.4.3
Component: postgis Version: 2.4.x
Keywords: Cc:

Description

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);
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~

Change History (3)

comment:1 Changed 2 years ago by pramsey

Milestone: PostGIS 2.4.1PostGIS 2.4.2

comment:2 Changed 2 years ago by pramsey

Milestone: PostGIS 2.4.2PostGIS 2.4.3

comment:3 Changed 2 years ago by pramsey

Resolution: fixed
Status: assignedclosed

Don't see this warning anymore, hope it just got fixed.

Note: See TracTickets for help on using tickets.