diff --git a/.github/workflows/build_ubuntu-22.04.sh b/.github/workflows/build_ubuntu-22.04.sh index 86017e33f29..179ff56f19b 100755 --- a/.github/workflows/build_ubuntu-22.04.sh +++ b/.github/workflows/build_ubuntu-22.04.sh @@ -20,8 +20,9 @@ fi # an old version of configure, which issues compiler warnings and # errors out. This may be removed with upgraded configure.in file. makecmd="make" -if [[ "$#" -eq 2 ]]; then - makecmd="make CFLAGS='$CFLAGS $2' CXXFLAGS='$CXXFLAGS $2'" +if [[ "$#" -ge 2 ]]; then + ARGS=("$@") + makecmd="make CFLAGS='$CFLAGS ${ARGS[@]:1}' CXXFLAGS='$CXXFLAGS ${ARGS[@]:1}'" fi # non-existent variables as an errors diff --git a/.github/workflows/gcc.yml b/.github/workflows/gcc.yml index 33ab0e5e059..a7e1963bd16 100644 --- a/.github/workflows/gcc.yml +++ b/.github/workflows/gcc.yml @@ -63,4 +63,6 @@ jobs: CFLAGS: -std=${{ matrix.c }} -fPIC -Wall -Wextra # TODO: -pedantic-errors here won't compile CXXFLAGS: -std=${{ matrix.cpp }} -fPIC -Wall -Wextra - run: .github/workflows/build_ubuntu-22.04.sh $HOME/install -Werror + run: | + .github/workflows/build_ubuntu-22.04.sh $HOME/install \ + -isystem/usr/include/gdal -Wpedantic -Werror diff --git a/.github/workflows/macos_install.sh b/.github/workflows/macos_install.sh index 42192c6ea6c..79828b933f6 100755 --- a/.github/workflows/macos_install.sh +++ b/.github/workflows/macos_install.sh @@ -66,12 +66,13 @@ CONFIGURE_FLAGS="\ --with-readline-libs=${CONDA_PREFIX}/lib " -export CFLAGS="-O2 -pipe -arch ${CONDA_ARCH} -DGL_SILENCE_DEPRECATION -Wall -Wextra" -export CXXFLAGS="-O2 -pipe -stdlib=libc++ -arch ${CONDA_ARCH} -Wall -Wextra" +export CFLAGS="-O2 -pipe -arch ${CONDA_ARCH} -DGL_SILENCE_DEPRECATION -Wall -Wextra -Wpedantic" +export CXXFLAGS="-O2 -pipe -stdlib=libc++ -arch ${CONDA_ARCH} -Wall -Wextra -Wpedantic" +export CPPFLAGS="-isystem${CONDA_PREFIX}/include" ./configure $CONFIGURE_FLAGS -EXEMPT="-Wno-error=deprecated-non-prototype" +EXEMPT="-Wno-error=deprecated-non-prototype -Wno-error=strict-prototypes" make -j$(sysctl -n hw.ncpu) CFLAGS="$CFLAGS -Werror $EXEMPT" \ CXXFLAGS="$CXXFLAGS -Werror $EXEMPT" diff --git a/include/grass/vect/dig_defines.h b/include/grass/vect/dig_defines.h index be33235dbb8..aeb9c673edf 100644 --- a/include/grass/vect/dig_defines.h +++ b/include/grass/vect/dig_defines.h @@ -225,6 +225,13 @@ typedef enum overlay_operator OVERLAY_OPERATOR; /*! \brief GRASS ASCII vector format - well-known-text format */ #define GV_ASCII_FORMAT_WKT 2 +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpedantic" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" +#endif /*! \brief Simple feature types Taken from GDAL/OGR library (ogr/ogr_core.h) @@ -252,6 +259,11 @@ typedef enum { SF_MULTIPOLYGON25D = 0x80000006, /* 2.5D extension as per 99-402 */ SF_GEOMETRYCOLLECTION25D = 0x80000007 /* 2.5D extension as per 99-402 */ } SF_FeatureType; +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif #define HEADSTR 50