From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 48E62A0545 for ; Tue, 20 Dec 2022 13:38:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40E5640685; Tue, 20 Dec 2022 13:38:10 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 7747040395 for ; Tue, 20 Dec 2022 13:38:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671539888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bmh/KGzKSKX3InUsc1baomPNkOQTBx5mivj7VnlbBkU=; b=bNowEa30bTqe668SUWuTY2isti1NjQzGwcq1daN2KFvYpfXx12yVfV76mqUZU3zhrbYnGe qrIF7zgPxa3rJC3d7NkUpiAhnsjYAC5ZPubVDA88ya8UDIZSWcINN6q6kHXhm/qctwP4Xi QD6pQz4IKIPWRVElOA8ZXmoCCR7xDsA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-523-643fHlRTNDCGW6OVu24new-1; Tue, 20 Dec 2022 07:38:05 -0500 X-MC-Unique: 643fHlRTNDCGW6OVu24new-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 892FD101CC60; Tue, 20 Dec 2022 12:38:04 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id B455214171C5; Tue, 20 Dec 2022 12:38:02 +0000 (UTC) From: Kevin Traynor To: stable@dpdk.org Cc: alialnu@nvidia.com, david.marchand@redhat.com, Kevin Traynor , Honnappa Nagarahalli , Konstantin Ananyev Subject: [PATCH 21.11] ring: squash gcc 12.2.1 warnings Date: Tue, 20 Dec 2022 12:37:54 +0000 Message-Id: <20221220123754.239802-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org gcc 12.2.1 on Fedora 37 is giving stringop-overread and stringop-overflow warnings when compiled with --buildtype=debug e.g. [1]. These are not yet fixed on main branch. They look similar to the overflow issues previously squashed in rte_memcpy with commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings") In order to ensure DPDK 21.11.3 compiles on Fedora 37, squash these warnings. If a subsequent cleaner fix becomes available on from main branch it can be backported to later DPDK 21.11 LTS release. [1] lib/ring/rte_ring_elem_pvt.h:100:25: error: ‘memcpy’ reading 32 bytes from a region of size 4 [-Werror=stringop-overread] 100 | memcpy((void *)(ring + idx), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 | (const void *)(obj + i), 32); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/ring/rte_ring_elem_pvt.h:234:25: error: ‘memcpy’ writing 32 bytes into a region of size 4 overflows the destination [-Werror=stringop-overflow=] 234 | memcpy((void *)(obj + i), (void *)(ring + idx), 32); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Kevin Traynor --- lib/ring/rte_ring_elem_pvt.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/ring/rte_ring_elem_pvt.h b/lib/ring/rte_ring_elem_pvt.h index 275ec55393..04b55c34a4 100644 --- a/lib/ring/rte_ring_elem_pvt.h +++ b/lib/ring/rte_ring_elem_pvt.h @@ -11,4 +11,10 @@ #define _RTE_RING_ELEM_PVT_H_ +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#pragma GCC diagnostic ignored "-Wstringop-overread" +#endif + static __rte_always_inline void __rte_ring_enqueue_elems_32(struct rte_ring *r, const uint32_t size, @@ -383,3 +389,7 @@ __rte_ring_do_dequeue_elem(struct rte_ring *r, void *obj_table, } +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000) +#pragma GCC diagnostic pop +#endif + #endif /* _RTE_RING_ELEM_PVT_H_ */ -- 2.38.1