From 2ac152158116a17b863270a4731977d9ddedf50d Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Tue, 6 Jul 2021 17:25:23 +0200 Subject: [PATCH] test/compress: fix Wstringop-overflow warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed warnings produced by gcc-11: compress_ut.c: In function ‘test_compress_operation’: compress_ut.c:726:9: warning: ‘_get_mbuf_array’ accessing 32 bytes in a region of size 24 [-Wstringop-overflow=] 726 | _get_mbuf_array(exp_src_mbuf, &g_expected_src_mbufs[0], SPDK_COUNTOF(exp_src_mbuf), false); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compress_ut.c:726:9: note: referencing argument 1 of type ‘struct rte_mbuf **’ compress_ut.c:430:1: note: in a call to function ‘_get_mbuf_array’ 430 | _get_mbuf_array(struct rte_mbuf *mbuf_array[UT_MBUFS_PER_OP_BOUND_TEST], | ^~~~~~~~~~~~~~~ Fixes issue #2013. Signed-off-by: Konrad Sztyber Change-Id: I04d0182169e61e87401f93f56993168d7aa42e43 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8692 Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-by: Paul Luse Reviewed-by: Ziye Yang Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins --- test/unit/lib/bdev/compress.c/compress_ut.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/lib/bdev/compress.c/compress_ut.c b/test/unit/lib/bdev/compress.c/compress_ut.c index 54a1f80c0e..599578ab45 100644 --- a/test/unit/lib/bdev/compress.c/compress_ut.c +++ b/test/unit/lib/bdev/compress.c/compress_ut.c @@ -427,8 +427,8 @@ _compress_done(void *_req, int reduce_errno) } static void -_get_mbuf_array(struct rte_mbuf *mbuf_array[UT_MBUFS_PER_OP_BOUND_TEST], - struct rte_mbuf *mbuf_head, int mbuf_count, bool null_final) +_get_mbuf_array(struct rte_mbuf **mbuf_array, struct rte_mbuf *mbuf_head, + int mbuf_count, bool null_final) { int i;