From 1154e4a8cfac242686b197c90c3100ef1fbabd93 Mon Sep 17 00:00:00 2001 From: jhendersonHDF Date: Mon, 25 Mar 2024 17:35:51 -0500 Subject: [PATCH] Turn on -Werror for Java in GitHub -Werror workflows --- .github/workflows/main-auto-spc.yml | 8 ++++++-- config/gnu-warnings/8 | 1 - config/gnu-warnings/error-8 | 11 +++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main-auto-spc.yml b/.github/workflows/main-auto-spc.yml index 3a7f72d4fbe..b0fc236ee33 100644 --- a/.github/workflows/main-auto-spc.yml +++ b/.github/workflows/main-auto-spc.yml @@ -417,8 +417,10 @@ jobs: sh ./autogen.sh mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" - CFLAGS=-Werror $GITHUB_WORKSPACE/configure \ + CFLAGS=-Werror JAVACFLAGS=-Werror JNIFLAGS=-Werror \ + $GITHUB_WORKSPACE/configure \ --enable-build-mode=debug \ + --enable-warnings-as-errors \ --enable-deprecated-symbols \ --with-default-api-version=v114 \ --enable-shared \ @@ -478,8 +480,10 @@ jobs: sh ./autogen.sh mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" - CFLAGS=-Werror $GITHUB_WORKSPACE/configure \ + CFLAGS=-Werror JAVACFLAGS=-Werror JNIFLAGS=-Werror \ + $GITHUB_WORKSPACE/configure \ --enable-build-mode=production \ + --enable-warnings-as-errors \ --enable-deprecated-symbols \ --with-default-api-version=v114 \ --enable-shared \ diff --git a/config/gnu-warnings/8 b/config/gnu-warnings/8 index 5e7519dd795..323110950b1 100644 --- a/config/gnu-warnings/8 +++ b/config/gnu-warnings/8 @@ -1,3 +1,2 @@ -Wattribute-alias --Wcast-align=strict -Wshift-overflow=2 diff --git a/config/gnu-warnings/error-8 b/config/gnu-warnings/error-8 index 36c14143228..25839a847b4 100644 --- a/config/gnu-warnings/error-8 +++ b/config/gnu-warnings/error-8 @@ -7,3 +7,14 @@ # that GCC 8 only performs that analysis at -O3, though. # -Werror=maybe-uninitialized +# Ask GCC to warn about cast-align problems, even on platforms where +# it normally wouldn't (because those platforms don't require alignment). +# While this flag doesn't follow the -Werror format like above, it's +# placed here to make sure that it comes after the -Werror=cast-align +# line from error-general in the list of flags. Otherwise, if the +# '--enable-warnings-as-errors' flag isn't passed at configure time, +# the logic in config/gnu-flags that demotes these errors to their +# normal warning form will cause -Wcast-align to come after +# -Wcast-align=strict in the list of flags, causing it to take +# precedence and mask cast-align warnings from GCC on certain platforms. +-Wcast-align=strict