From ebef6b5ced85a91ad75bcfc921fd8b04b0d3ab6e Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 4 Oct 2022 17:12:15 +0900 Subject: [PATCH 1/2] workflow: Bump compilers --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ffcd334a..b810f650 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,8 +36,8 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get install \ - g++-11 \ - clang-12 \ + g++-12 \ + clang-14 \ autoconf \ automake \ autotools-dev \ @@ -74,8 +74,8 @@ jobs: - name: Setup clang (Linux) if: runner.os == 'Linux' && matrix.compiler == 'clang' run: | - echo 'CC=clang-12' >> $GITHUB_ENV - echo 'CXX=clang++-12' >> $GITHUB_ENV + echo 'CC=clang-14' >> $GITHUB_ENV + echo 'CXX=clang++-14' >> $GITHUB_ENV - name: Setup clang (MacOS) if: runner.os == 'macOS' && matrix.compiler == 'clang' run: | @@ -84,8 +84,8 @@ jobs: - name: Setup gcc (Linux) if: runner.os == 'Linux' && matrix.compiler == 'gcc' run: | - echo 'CC=gcc-11' >> $GITHUB_ENV - echo 'CXX=g++-11' >> $GITHUB_ENV + echo 'CC=gcc-12' >> $GITHUB_ENV + echo 'CXX=g++-12' >> $GITHUB_ENV - name: Setup gcc (MacOS) if: runner.os == 'macOS' && matrix.compiler == 'gcc' run: | From 8a355db8d92c983f36e0b5821444f5c084b28397 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 4 Oct 2022 17:44:26 +0900 Subject: [PATCH 2/2] 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);