[postgis-tickets] r17865 - Guard some newer GCC'isms to allow older platforms

Paul Ramsey pramsey at cleverelephant.ca
Sun Oct 6 06:36:19 PDT 2019


Author: pramsey
Date: 2019-10-06 18:36:19 -0700 (Sun, 06 Oct 2019)
New Revision: 17865

Modified:
   trunk/postgis/lwgeom_functions_basic.c
   trunk/postgis/lwgeom_geos.c
   trunk/raster/rt_pg/rtpg_mapalgebra.c
Log:
Guard some newer GCC'isms to allow older platforms 
to still build


Modified: trunk/postgis/lwgeom_functions_basic.c
===================================================================
--- trunk/postgis/lwgeom_functions_basic.c	2019-10-07 01:31:00 UTC (rev 17864)
+++ trunk/postgis/lwgeom_functions_basic.c	2019-10-07 01:36:19 UTC (rev 17865)
@@ -1546,10 +1546,14 @@
 		holes = lwalloc(sizeof(LWLINE *) * nholes);
 		for (i = 0; i < nholes; i++)
 		{
+#if GCC_VERSION >= 40604
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wsign-compare"
+#endif
 			GSERIALIZED *g = (GSERIALIZED *)(ARR_DATA_PTR(array) + offset);
+#if GCC_VERSION >= 40604
 #pragma GCC diagnostic pop
+#endif
 			LWLINE *hole;
 			offset += INTALIGN(VARSIZE(g));
 			if (gserialized_get_type(g) != LINETYPE)

Modified: trunk/postgis/lwgeom_geos.c
===================================================================
--- trunk/postgis/lwgeom_geos.c	2019-10-07 01:31:00 UTC (rev 17864)
+++ trunk/postgis/lwgeom_geos.c	2019-10-07 01:36:19 UTC (rev 17865)
@@ -390,10 +390,14 @@
 	/* One geom, good geom? Return it */
 	if ( count == 1 && nelems == 1 )
 	{
+#if GCC_VERSION >= 40604
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wsign-compare"
+#endif
 		PG_RETURN_POINTER((GSERIALIZED *)(ARR_DATA_PTR(array)));
+#if GCC_VERSION >= 40604
 #pragma GCC diagnostic pop
+#endif
 	}
 
 	/* Ok, we really need GEOS now ;) */

Modified: trunk/raster/rt_pg/rtpg_mapalgebra.c
===================================================================
--- trunk/raster/rt_pg/rtpg_mapalgebra.c	2019-10-07 01:31:00 UTC (rev 17864)
+++ trunk/raster/rt_pg/rtpg_mapalgebra.c	2019-10-07 01:36:19 UTC (rev 17865)
@@ -78,8 +78,10 @@
 /* ---------------------------------------------------------------- */
 
 /* Quiet warning */
+#if GCC_VERSION >= 40604
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
+#endif
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wgnu-variable-sized-type-not-at-end"
 
@@ -100,7 +102,9 @@
 } rtpg_nmapalgebra_callback_arg;
 
 #pragma clang diagnostic pop
+#if GCC_VERSION >= 40604
 #pragma GCC diagnostic pop
+#endif
 /* ! Quiet warning */
 
 typedef struct rtpg_nmapalgebra_arg_t *rtpg_nmapalgebra_arg;



More information about the postgis-tickets mailing list