From 17faecc94d304a1cfc879db78a033c354007458c Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 26 Oct 2024 19:36:05 +0200 Subject: [PATCH] ogr_core.h: suppress warning when building with -Wpedantic for C < 23 Fixes #2322 --- ogr/ogr_core.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ogr/ogr_core.h b/ogr/ogr_core.h index f64ecc40d6de..d0e772f51d86 100644 --- a/ogr/ogr_core.h +++ b/ogr/ogr_core.h @@ -391,6 +391,13 @@ typedef int OGRBoolean; /* ogr_geometry.h related definitions. */ /* -------------------------------------------------------------------- */ +#if defined(HAVE_GCC_DIAGNOSTIC_PUSH) && __STDC_VERSION__ < 202311L +// wkbPoint25D and friends cause warnings with -Wpedantic prior to C23 +// Cf https://github.com/OSGeo/gdal/issues/2322 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" +#endif + /** * List of well known binary geometry types. These are used within the BLOBs * but are also returned from OGRGeometry::getGeometryType() to identify the @@ -512,6 +519,10 @@ typedef enum #endif } OGRwkbGeometryType; +#if defined(HAVE_GCC_DIAGNOSTIC_PUSH) && __STDC_VERSION__ < 202311L +#pragma GCC diagnostic pop +#endif + /* clang-format off */ /** * Output variants of WKB we support.