GEOS 3.13 and GEOSMessageHandler

Sandro Santilli strk at kbt.io
Wed Aug 28 03:16:39 PDT 2024


On Thu, Aug 22, 2024 at 10:58:20AM -0700, Paul Ramsey wrote:
> 
> 
> > On Aug 22, 2024, at 10:14 AM, Sandro Santilli <strk at kbt.io> wrote:
> > 
> > On Thu, Aug 22, 2024 at 08:23:20AM -0700, Paul Ramsey wrote:
> > 
> >> /usr/local/include/geos_c.h:105:16: warning: redefinition of typedef 'GEOSMessageHandler' is a C11 feature [-Wtypedef-redefinition]
> >> typedef void (*GEOSMessageHandler)(const char *fmt, ...);
> >> 
> >> ../../liblwgeom/lwgeom_geos.h:28:16: note: previous definition is here
> >> typedef void (*GEOSMessageHandler)(const char *fmt, ...) __attribute__ (( format(printf, 1, 0) ));
> >> ```
> >> 
> >> A fairly reasonable warning, IMO, since redefining something we are pulling in from another library is quite a bit of a hack, and dangerous in its own right.
> > 
> > It'd dangerous only if the upstream definition can change, but we're
> > only redefining for GEOS versions below a given number os we know the
> > definition is NOT going to change, removing that danger.
> > 
> > All you need is to tell your compiler that you are using C11 features ?
> 
> Is our C standard c11? I thought we were c99. 

We're passing -std=gnu99 as a compiler switch when available [1],
but if I pass -pedantic to the build line I get notified that
PostgreSQL headers use C11 constructs:

  /usr/include/postgresql/16/server/storage/lwlock.h:63:1: warning: '_Static_assert' is a C11 extension [-Wc11-extensions] 

I don't find any indication in the README as to which capabilities the
C compiler must have. What about going -std=gnu11 and see how it goes ?
Note we use C++11 for Wagyu and FlatGeobuf.

[1] https://trac.osgeo.org/postgis/ticket/4234

--strk;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20240828/67c13042/attachment.sig>


More information about the postgis-devel mailing list