Skip to content

Commit

Permalink
build: add "-Wvla" and "-Wdeclaration-after-statement" to default CFLAGS
Browse files Browse the repository at this point in the history
Instead of having those flags on only in the build script of github CI,
add them to the default flags in "Makefile.am".
  • Loading branch information
thom311 committed May 29, 2024
1 parent 7e05b62 commit 131008f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
set -x
export CC="${{ matrix.cc }}"
export CFLAGS="-DNL_MORE_ASSERTS=1000 -O2 -Werror -Wall -Wdeclaration-after-statement -Wvla -std=gnu11 -fexceptions"
export CFLAGS="-DNL_MORE_ASSERTS=1000 -O2 -Werror -std=gnu11 -fexceptions"
CONFIGURE_ARGS=
if [ "$CC" = "clang" ]; then
CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument -Wno-error=unused-function"
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
set -x
git clean -fdx
export CC="${{ matrix.cc }}"
export CFLAGS="-Werror -Wall -Wdeclaration-after-statement -Wvla -std=gnu11 -fexceptions"
export CFLAGS="-Werror -std=gnu11 -fexceptions"
if [ "$CC" = "clang" ]; then
CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument -Wno-error=unused-function"
fi
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
set -x
export CC="${{ matrix.cc }}"
export CFLAGS="-DNL_MORE_ASSERTS=1000 -O2 -Werror -Wall -Wdeclaration-after-statement -Wvla -std=gnu11 -fexceptions"
export CFLAGS="-DNL_MORE_ASSERTS=1000 -O2 -Werror -std=gnu11 -fexceptions"
if [ "$CC" = "clang" ]; then
CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument -Wno-error=unused-function"
export LDFLAGS="-Wl,--no-undefined-version,--fatal-warnings"
Expand Down
10 changes: 7 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@ pkgconfig_DATA = \
warn_cppflags = \
-Wall \
-Wextra \
\
-Wdeclaration-after-statement \
-Wmissing-prototypes \
-Wno-unused-parameter \
-Wno-sign-compare \
-Wno-missing-field-initializers \
-Wpointer-arith \
-Wvla \
\
-Wno-missing-field-initializers \
-Wno-sign-compare \
-Wno-unused-parameter \
$(NULL)

###############################################################################
Expand Down

0 comments on commit 131008f

Please sign in to comment.