summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-12-27 18:44:01 -0800
committerJohn Hawthorn <john@hawthorn.email>2019-12-27 22:25:01 -0800
commit66316266df901eab81ae116c6e0728d10d0214e4 (patch)
treeba3ff5313500d3b0078c78e1daadce36460c8a3d
parentf7a62107b72152cd19dab1c13c027e4190a1997c (diff)
Error on usage of VLA
-rw-r--r--Makefile2
-rw-r--r--test/test_choices.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index c1f6234..746994f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION=1.0
CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
-CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic -Ideps
+CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic -Ideps -Werror=vla
PREFIX?=/usr/local
MANDIR?=$(PREFIX)/share/man
BINDIR?=$(PREFIX)/bin
diff --git a/test/test_choices.c b/test/test_choices.c
index 3ad7d6a..d86bc12 100644
--- a/test/test_choices.c
+++ b/test/test_choices.c
@@ -135,8 +135,8 @@ TEST test_choices_unicode() {
}
TEST test_choices_large_input() {
- int N = 100000;
- char *strings[N];
+ const int N = 100000;
+ char *strings[100000];
for(int i = 0; i < N; i++) {
asprintf(&strings[i], "%i", i);