From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Stephen Hemminger" <stephen@networkplumber.org>,
"Bruce Richardson" <bruce.richardson@intel.com>
Cc: <dev@dpdk.org>
Subject: RE: [PATCH] build: force gcc to initialize padding bits
Date: Fri, 24 Jan 2025 08:48:45 +0100 [thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F9E6@smartserver.smartshare.dk> (raw)
In-Reply-To: <20250123172048.134417-1-stephen@networkplumber.org>
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Thursday, 23 January 2025 18.21
>
> 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.
>
> Use the new zero initialization flag to force the old behavior
> of initializing everything to zero.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> config/meson.build | 3 +++
> 1 file changed, 3 insertions(+)
>
> 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 = [
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=all',
> ]
>
> 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ørup <mb@smartsharesystems.com>
next prev parent reply other threads:[~2025-01-24 7:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-23 17:20 [PATCH] build: force gcc to initialize padding bits Stephen Hemminger
2025-01-24 7:48 ` Morten Brørup [this message]
2025-01-24 9:38 ` Bruce Richardson
2025-01-24 18:37 ` Stephen Hemminger
2025-01-27 14:34 ` Bruce Richardson
2025-01-24 18:26 ` [PATCH v2] " Stephen Hemminger
2025-01-27 14:35 ` Bruce Richardson
2025-02-11 11:06 ` David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=98CBD80474FA8B44BF855DF32C47DC35E9F9E6@smartserver.smartshare.dk \
--to=mb@smartsharesystems.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.