Skip to content

Commit 5ba77fd

Browse files
committed
fix c++ tests build warning, VLA is not standard but an extension.
1 parent 51cc4b7 commit 5ba77fd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/tests.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <memory>
55
#include <array>
6+
#include <vector>
67
#if THREAD_SUPPORT
78
#include <thread>
89
#endif
@@ -62,8 +63,8 @@ class Derived : Base {
6263
};
6364

6465
int allocate(size_t array_size, size_t allocation_size) {
65-
void *p[array_size];
66-
memset(p, 0x0, array_size);
66+
std::vector<void *> p(array_size);
67+
memset(p.data(), 0x0, p.size());
6768

6869
for(size_t i = 0; i < array_size; i++) {
6970
if(allocation_size == 0) {

0 commit comments

Comments
 (0)