Browse code

Error on usage of VLA

John Hawthorn authored on 28/12/2019 02:44:01
Showing 2 changed files

... ...
@@ -1,7 +1,7 @@
1 1
 VERSION=1.0
2 2
 
3 3
 CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
4
-CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic -Ideps
4
+CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic -Ideps -Werror=vla
5 5
 PREFIX?=/usr/local
6 6
 MANDIR?=$(PREFIX)/share/man
7 7
 BINDIR?=$(PREFIX)/bin
... ...
@@ -135,8 +135,8 @@ TEST test_choices_unicode() {
135 135
 }
136 136
 
137 137
 TEST test_choices_large_input() {
138
-	int N = 100000;
139
-	char *strings[N];
138
+	const int N = 100000;
139
+	char *strings[100000];
140 140
 
141 141
 	for(int i = 0; i < N; i++) {
142 142
 		asprintf(&strings[i], "%i", i);