From 8a355db8d92c983f36e0b5821444f5c084b28397 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 4 Oct 2022 17:44:26 +0900 Subject: [PATCH] Fix compile error with gcc-12 --- src/memchunk_test.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/memchunk_test.cc b/src/memchunk_test.cc index fe0a892c..236d9ea4 100644 --- a/src/memchunk_test.cc +++ b/src/memchunk_test.cc @@ -151,9 +151,9 @@ void test_memchunks_riovec(void) { MemchunkPool16 pool; Memchunks16 chunks(&pool); - char buf[3 * 16]; + std::array buf{}; - chunks.append(buf, sizeof(buf)); + chunks.append(buf.data(), buf.size()); std::array iov; auto iovcnt = chunks.riovec(iov.data(), iov.size()); @@ -184,8 +184,8 @@ void test_memchunks_recycle(void) { MemchunkPool16 pool; { Memchunks16 chunks(&pool); - char buf[32]; - chunks.append(buf, sizeof(buf)); + std::array buf{}; + chunks.append(buf.data(), buf.size()); } CU_ASSERT(32 == pool.poolsize); CU_ASSERT(nullptr != pool.freelist);