Fix -Wvla warnings
@@ -130,8 +130,8 @@ void run_ipX_tests(MMDB_s *mmdb,
int pairs_rows,
int mode,
const char *mode_desc) {
- pthread_t threads[pairs_rows];
- struct thread_arg thread_args[pairs_rows];
+ pthread_t *threads = malloc((unsigned long)pairs_rows * sizeof(pthread_t));
+ struct thread_arg *thread_args = malloc((unsigned long)pairs_rows * sizeof(struct thread_arg));
for (int i = 0; i < pairs_rows; i += 1) {
thread_args[i].thread_id = i;
@@ -161,6 +161,9 @@ void run_ipX_tests(MMDB_s *mmdb,
free(test_result);
}
}
+
+ free(threads);
+ free(thread_args);
}
void run_tests(int mode, const char *mode_desc) {
