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 40E3A4611A; Fri, 24 Jan 2025 08:48:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 002B040E11; Fri, 24 Jan 2025 08:48:48 +0100 (CET) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id C407E402E9 for ; Fri, 24 Jan 2025 08:48:47 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id A29B62091D; Fri, 24 Jan 2025 08:48:46 +0100 (CET) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: [PATCH] build: force gcc to initialize padding bits Content-Transfer-Encoding: quoted-printable Date: Fri, 24 Jan 2025 08:48:45 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F9E6@smartserver.smartshare.dk> X-MimeOLE: Produced By Microsoft Exchange V6.5 In-Reply-To: <20250123172048.134417-1-stephen@networkplumber.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] build: force gcc to initialize padding bits Thread-Index: Adttu1NzvjQYqk2wQtiyKC5bO58VMAAeGBmw References: <20250123172048.134417-1-stephen@networkplumber.org> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Stephen Hemminger" , "Bruce Richardson" Cc: X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Thursday, 23 January 2025 18.21 >=20 > With GCC 15, the compiler has changed the default behavior when > initialization is used for aggregate variables. The new default > is to follow the standard (C23) and not initialize everything by > default. This breaks assumptions in some drivers and can be > lead to other bugs. >=20 > Use the new zero initialization flag to force the old behavior > of initializing everything to zero. >=20 > Signed-off-by: Stephen Hemminger > --- > config/meson.build | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/config/meson.build b/config/meson.build > index 6aaad6d8a4..5c8b5a15f5 100644 > --- a/config/meson.build > +++ b/config/meson.build > @@ -330,6 +330,9 @@ warning_flags =3D [ Is warning_flags the right location for this? Alternatively, should warning_flags be renamed? > # globally disabled warnings > '-Wno-packed-not-aligned', > '-Wno-missing-field-initializers', > + > + # guarantee that everything is zero when using initialization Maybe add ", like in the C23 standard" to the comment. > + '-fzero-init-padding-bits=3Dall', > ] >=20 > if not dpdk_conf.get('RTE_ARCH_64') > -- > 2.45.2 I have read up on -fzero-init-padding-bits, and this is the correct = solution. With or without suggested changes: Acked-by: Morten Br=F8rup