Fix compile error with gcc-12

This commit is contained in:
Tatsuhiro Tsujikawa 2022-10-04 17:44:26 +09:00
parent ebef6b5ced
commit 8a355db8d9
1 changed files with 4 additions and 4 deletions

View File

@ -151,9 +151,9 @@ void test_memchunks_riovec(void) {
MemchunkPool16 pool; MemchunkPool16 pool;
Memchunks16 chunks(&pool); Memchunks16 chunks(&pool);
char buf[3 * 16]; std::array<char, 3 * 16> buf{};
chunks.append(buf, sizeof(buf)); chunks.append(buf.data(), buf.size());
std::array<struct iovec, 2> iov; std::array<struct iovec, 2> iov;
auto iovcnt = chunks.riovec(iov.data(), iov.size()); auto iovcnt = chunks.riovec(iov.data(), iov.size());
@ -184,8 +184,8 @@ void test_memchunks_recycle(void) {
MemchunkPool16 pool; MemchunkPool16 pool;
{ {
Memchunks16 chunks(&pool); Memchunks16 chunks(&pool);
char buf[32]; std::array<char, 32> buf{};
chunks.append(buf, sizeof(buf)); chunks.append(buf.data(), buf.size());
} }
CU_ASSERT(32 == pool.poolsize); CU_ASSERT(32 == pool.poolsize);
CU_ASSERT(nullptr != pool.freelist); CU_ASSERT(nullptr != pool.freelist);