[SCM] PostGIS branch master updated. 3.5.0alpha2-40-g2260a5043
git at osgeo.org
git at osgeo.org
Wed Aug 28 03:43:34 PDT 2024
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via 2260a504389889bbc91cb1293bfc7aae861719fd (commit)
from 17e8bf342362fc9b4ecf6d05ce4fde2837af6194 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2260a504389889bbc91cb1293bfc7aae861719fd
Author: Sandro Santilli <strk at kbt.io>
Date: Wed Aug 28 12:43:12 2024 +0200
Add more printf attribute specifications and fix related warnings
diff --git a/libpgcommon/lwgeom_pg.c b/libpgcommon/lwgeom_pg.c
index ba4d80e11..eb7dea249 100644
--- a/libpgcommon/lwgeom_pg.c
+++ b/libpgcommon/lwgeom_pg.c
@@ -350,6 +350,8 @@ pg_free(void *ptr)
pfree(ptr);
}
+static void pg_error(const char *fmt, va_list ap) __attribute__ (( format(printf, 1, 0) ));
+
static void
pg_error(const char *fmt, va_list ap)
{
@@ -361,6 +363,8 @@ pg_error(const char *fmt, va_list ap)
ereport(ERROR, (errmsg_internal("%s", errmsg)));
}
+static void pg_warning(const char *fmt, va_list ap) __attribute__ (( format(printf, 1, 0) ));
+
static void
pg_warning(const char *fmt, va_list ap)
{
@@ -372,6 +376,8 @@ pg_warning(const char *fmt, va_list ap)
ereport(WARNING, (errmsg_internal("%s", errmsg)));
}
+static void pg_notice(const char *fmt, va_list ap) __attribute__ (( format(printf, 1, 0) ));
+
static void
pg_notice(const char *fmt, va_list ap)
{
@@ -383,6 +389,8 @@ pg_notice(const char *fmt, va_list ap)
ereport(NOTICE, (errmsg_internal("%s", errmsg)));
}
+static void pg_debug(int level, const char *fmt, va_list ap) __attribute__ (( format(printf, 2, 0) ));
+
static void
pg_debug(int level, const char *fmt, va_list ap)
{
diff --git a/libpgcommon/lwgeom_pg.h b/libpgcommon/lwgeom_pg.h
index b6f6973c2..37875599f 100644
--- a/libpgcommon/lwgeom_pg.h
+++ b/libpgcommon/lwgeom_pg.h
@@ -252,9 +252,9 @@ Datum LWGEOM_getBBOX(PG_FUNCTION_ARGS);
Datum LWGEOM_addBBOX(PG_FUNCTION_ARGS);
Datum LWGEOM_dropBBOX(PG_FUNCTION_ARGS);
-void lwpgerror(const char *fmt, ...);
-void lwpgnotice(const char *fmt, ...);
-void lwpgwarning(const char *fmt, ...);
+void lwpgerror(const char *fmt, ...) __attribute (( format(printf, 1, 2) ));
+void lwpgnotice(const char *fmt, ...) __attribute (( format(printf, 1, 2) ));
+void lwpgwarning(const char *fmt, ...) __attribute (( format(printf, 1, 2) ));
Datum CallerFInfoFunctionCall3(PGFunction func, FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3);
diff --git a/postgis/lwgeom_window.c b/postgis/lwgeom_window.c
index ddff4685c..eebd6ec57 100644
--- a/postgis/lwgeom_window.c
+++ b/postgis/lwgeom_window.c
@@ -142,12 +142,12 @@ Datum ST_ClusterDBSCAN(PG_FUNCTION_ARGS)
/* Validate input parameters */
if (tolerance_is_null || tolerance < 0)
{
- lwpgerror("Tolerance must be a positive number", tolerance);
+ lwpgerror("Tolerance must be a positive number, got %g", tolerance);
PG_RETURN_NULL();
}
if (minpoints_is_null || minpoints < 0)
{
- lwpgerror("Minpoints must be a positive number", minpoints);
+ lwpgerror("Minpoints must be a positive number, got %d", minpoints);
}
initGEOS(lwpgnotice, lwgeom_geos_error);
@@ -228,7 +228,7 @@ Datum ST_ClusterWithinWin(PG_FUNCTION_ARGS)
/* Validate input parameters */
if (tolerance_is_null || tolerance < 0)
{
- lwpgerror("Tolerance must be a positive number", tolerance);
+ lwpgerror("Tolerance must be a positive number, got %g", tolerance);
PG_RETURN_NULL();
}
diff --git a/topology/postgis_topology.c b/topology/postgis_topology.c
index 3a3441480..d8b4782a8 100644
--- a/topology/postgis_topology.c
+++ b/topology/postgis_topology.c
@@ -1525,7 +1525,7 @@ cb_getNodeWithinDistance2D(const LWT_BE_TOPOLOGY *topo,
else
{
lwpgwarning("liblwgeom-topo invoked 'getNodeWithinDistance2D' "
- "backend callback with limit=%d and no fields",
+ "backend callback with limit=%ld and no fields",
elems_requested);
appendStringInfo(sql, "*");
}
-----------------------------------------------------------------------
Summary of changes:
libpgcommon/lwgeom_pg.c | 8 ++++++++
libpgcommon/lwgeom_pg.h | 6 +++---
postgis/lwgeom_window.c | 6 +++---
topology/postgis_topology.c | 2 +-
4 files changed, 15 insertions(+), 7 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list