Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn on -Werror for Java in GitHub -Werror workflows #4243

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/main-auto-spc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down
1 change: 0 additions & 1 deletion config/gnu-warnings/8
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
-Wattribute-alias
-Wcast-align=strict
-Wshift-overflow=2
11 changes: 11 additions & 0 deletions config/gnu-warnings/error-8
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While clang always seems to warn about cast-align problems, GCC won't on some platforms like x86 and others unless you specify cast-align=strict (because those platforms don't require alignment). We were adding this in config/gnu-warnings/8, but the way the flags ended up being ordered was causing the '-Werror=cast-align' line from config/gnu-warnings/error-general to come later than the strict version, causing it to take precedence and hide these warnings with GCC.

Loading