Skip to content

Commit

Permalink
CI: add -Werror to "GCC C/C++ Standards Check" (#1804)
Browse files Browse the repository at this point in the history
Present version of the configure.in file is old and issues compiler
warnings, thus errors out. The -Werror flag must thus be given
to 'make'.

The compiler flag -fPIC is needed for -Werror to work.
  • Loading branch information
nilason committed Aug 26, 2021
1 parent 4c7db5b commit 6a34ab1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/build_ubuntu-20.04.sh
Expand Up @@ -16,6 +16,14 @@ if [ -z "$1" ]; then
exit 1
fi

# Adding -Werror to make's CFLAGS is a workaround for configuring with
# 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'"
fi

# non-existent variables as an errors
set -u

Expand All @@ -42,5 +50,5 @@ export INSTALL_PREFIX=$1
--with-fftw \
--with-netcdf

make
eval $makecmd
make install
6 changes: 3 additions & 3 deletions .github/workflows/gcc.yml
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Build
env:
# TODO: -pedantic-errors here won't go through ./configure (with GNU C)
CFLAGS: "-std=${{ matrix.c }}"
CFLAGS: "-std=${{ matrix.c }} -fPIC"
# TODO: -pedantic-errors here won't compile
CXXFLAGS: "-std=${{ matrix.cpp }}"
run: .github/workflows/build_ubuntu-20.04.sh $HOME/install
CXXFLAGS: "-std=${{ matrix.cpp }} -fPIC"
run: .github/workflows/build_ubuntu-20.04.sh $HOME/install -Werror

0 comments on commit 6a34ab1

Please sign in to comment.