From: Paul Ramsey Date: Mon, 7 Oct 2019 01:36:19 +0000 (+0000) Subject: Guard some newer GCC'isms to allow older platforms X-Git-Tag: 3.0.0rc1~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67fa0176923aa800f69060b561732f15e82de0f9;p=postgis Guard some newer GCC'isms to allow older platforms to still build git-svn-id: http://svn.osgeo.org/postgis/trunk@17865 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c index f39474813..3bc7d9b49 100644 --- a/postgis/lwgeom_functions_basic.c +++ b/postgis/lwgeom_functions_basic.c @@ -1546,10 +1546,14 @@ Datum LWGEOM_makepoly(PG_FUNCTION_ARGS) 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) diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index 828421625..eb4a55442 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -390,10 +390,14 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS) /* 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 ;) */ diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index f447834d9..7ccb91c4c 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -78,8 +78,10 @@ Datum RASTER_mapAlgebra2(PG_FUNCTION_ARGS); /* ---------------------------------------------------------------- */ /* 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 @@ typedef struct { } 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;