From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2126606A325 for ; Tue, 1 Dec 2026 09:01:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=T8Fs7/dk Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9DC8440615; Tue, 1 Dec 2026 10:01:53 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTPS id A0DDA40289 for ; Tue, 1 Dec 2026 10:01:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796115711; 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: in-reply-to:in-reply-to:references:references; bh=UF076DS3282xnJmtwCcJiaXnG8zMnt8eI1U47DWpgp0=; b=T8Fs7/dkDIRQJdLRyZzS2pO+F93GMbUKtQCyK9VlxZNY7QxCjP3p0ki1NMHe5qP80XAYWC WynL+7Nc4ZB8VGba0ufD7EOUA96EDlL0/i1wnEkkoOEsi4GEIaF37xW8PjIqnRj6/HThLz aaDUMzrGhfuK8tneCFZeHsAl6kbXWZs= X-MC-Rep: binary re single Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-482-Xfhrrb0hORGQkW3PMgsaJg-1; Tue, 1 Dec 2026 09:01:46 +0000 X-MC-Unique: Xfhrrb0hORGQkW3PMgsaJg-1 X-Mimecast-MFC-AGG-ID: Xfhrrb0hORGQkW3PMgsaJg_1796115705 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CCCE71800674; Tue, 1 Dec 2026 09:01:44 +0000 (UTC) Received: from ringo.home (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EE56E1801977; Tue, 1 Dec 2026 09:01:42 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org, Konstantin Ananyev , Wathsala Vithanage , Stephen Hemminger , =?UTF-8?q?Morten=20Br=C3=B8rup?= Cc: stable@dpdk.org Subject: [PATCH dpdk v3] ring: suppress unoptimized GCC string warnings locally Date: Tue, 1 Dec 2026 10:01:20 +0100 Message-ID: <20261201090119.387607-2-rjarry@redhat.com> In-Reply-To: <20261130122929.246502-2-rjarry@redhat.com> References: <20261130122929.246502-2-rjarry@redhat.com> X-Archived-By: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 4hYr-thh-nvAXC1r471IO3sRn0f-S7d4IRJFSk3ynV0_1796115705 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 The global_cflags change in 812a18c167f4 ("build: disable GCC string op warnings when unoptimized") only applies to DPDK's own build. It is not propagated through pkg-config or as subproject exported flags, so applications that pull in rte_ring_elem_pvt.h and build at -O0 with GCC 14 or GCC 16 still hit the stringop-overflow/stringop-overread false positives, and treating warnings as errors turns that into a compile error. Pragmas are generally discouraged in DPDK, but there is no other way to suppress a warning for code included by an external application build. Restrict the pragmas to the 128-bit copy helpers so application diagnostics stay enabled everywhere else. Unlike the pragmas these replace, which disabled the warnings unconditionally from GCC 12 onward, these only apply with GCC *and* -O0, matching the condition in config/meson.build. The version check is dropped because it is unclear which GCC versions are actually affected. Fixes: 812a18c167f4 ("build: disable GCC string op warnings when unoptimized") Cc: stable@dpdk.org Signed-off-by: Robin Jarry --- Notes: v3: replaced nonsense hack with local warnings suppressions v2: also fix the dequeue path lib/ring/rte_ring_elem_pvt.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/ring/rte_ring_elem_pvt.h b/lib/ring/rte_ring_elem_pvt.h index 77a2efafe119..185c26281005 100644 --- a/lib/ring/rte_ring_elem_pvt.h +++ b/lib/ring/rte_ring_elem_pvt.h @@ -90,6 +90,13 @@ __rte_ring_enqueue_elems_64(void *ring_table, const void *obj_table, } } +/* DPDK's -O0 warning flags do not apply to applications including this header. */ +#if defined(RTE_TOOLCHAIN_GCC) && !defined(__OPTIMIZE__) +#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_128(void *ring_table, const void *obj_table, uint32_t size, uint32_t idx, uint32_t n) @@ -119,6 +126,10 @@ __rte_ring_enqueue_elems_128(void *ring_table, const void *obj_table, } } +#if defined(RTE_TOOLCHAIN_GCC) && !defined(__OPTIMIZE__) +#pragma GCC diagnostic pop +#endif + /* the actual enqueue of elements on the ring. * Placed here since identical code needed in both * single and multi producer enqueue functions. @@ -233,6 +244,12 @@ __rte_ring_dequeue_elems_64(void *obj_table, const void *ring_table, } } +#if defined(RTE_TOOLCHAIN_GCC) && !defined(__OPTIMIZE__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#pragma GCC diagnostic ignored "-Wstringop-overread" +#endif + static __rte_always_inline void __rte_ring_dequeue_elems_128(void *obj_table, const void *ring_table, uint32_t size, uint32_t idx, uint32_t n) @@ -257,6 +274,10 @@ __rte_ring_dequeue_elems_128(void *obj_table, const void *ring_table, } } +#if defined(RTE_TOOLCHAIN_GCC) && !defined(__OPTIMIZE__) +#pragma GCC diagnostic pop +#endif + /* the actual dequeue of elements from the ring. * Placed here since identical code needed in both * single and multi producer enqueue functions. -- 2.56.1