Skip to content

Commit

Permalink
build: add "-Wvla" to default CFLAGS
Browse files Browse the repository at this point in the history
Variable length arrays silently break _NL_STATIC_ASSERT(), if the
argument of the assertion is not a constant. Avoid that pitfall, by not
allowing VLAs.

That was already the case earlier, and the github CI checked for that.
Now also add "-Wvla" to the default flags.
  • Loading branch information
thom311 committed May 29, 2024
1 parent 7e05b62 commit f6adec0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ pkgconfig_DATA = \
warn_cppflags = \
-Wall \
-Wextra \
\
-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 f6adec0

Please sign in to comment.