Skip to content

Commit

Permalink
Add -Werror=vla by default. C99 variable-length arrays are dangerous.
Browse files Browse the repository at this point in the history
C11 makes them optional, and MSVC doesn't support them. We can't use them
(but even if we could, we should not).
  • Loading branch information
nwc10 committed Jun 11, 2021
1 parent 7d4b8f5 commit 7886147
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cflags.SH
Expand Up @@ -180,6 +180,7 @@ Intel*) ;; # # Is that you, Intel C++?
#
*) warns="-std=c89 -ansi $pedantic \
-Werror=pointer-arith \
-Werror=vla \
-Wextra -W \
-Wc++-compat -Wwrite-strings"
# declaration after statement is normal in C++ rather than an
Expand Down

0 comments on commit 7886147

Please sign in to comment.