From: Leo Yan <leo.yan@arm.com>
To: Nick Desaulniers <ndesaulniers@google.com>,
Nathan Chancellor <nathan@kernel.org>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Ian Rogers <irogers@google.com>,
Namhyung Kim <namhyung@kernel.org>,
James Clark <james.clark@linaro.org>, Kees Cook <kees@kernel.org>,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH v2] tools build: Use -fzero-init-padding-bits=all
Date: Tue, 22 Apr 2025 08:58:26 +0100 [thread overview]
Message-ID: <20250422075826.GA28953@e132581.arm.com> (raw)
In-Reply-To: <20250402173056.829400-1-leo.yan@arm.com>
On Wed, Apr 02, 2025 at 06:30:56PM +0100, Leo Yan wrote:
> GCC-15 release claims [1]:
>
> {0} initializer in C or C++ for unions no longer guarantees clearing
> of the whole union (except for static storage duration initialization),
> it just initializes the first union member to zero. If initialization
> of the whole union including padding bits is desirable, use {} (valid
> in C23 or C++) or use -fzero-init-padding-bits=unions option to
> restore old GCC behavior.
>
> As a result, this new behaviour might cause unexpected data when we
> initialize a union with using the '{ 0 }' initializer.
>
> Since commit dce4aab8441d ("kbuild: Use -fzero-init-padding-bits=all"),
> the kernel has enabled -fzero-init-padding-bits=all to zero padding bits
> in unions and structures. This commit applies the same option for tools
> building.
Gentle ping.
Thanks,
Leo
prev parent reply other threads:[~2025-04-22 7:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-02 17:30 [PATCH v2] tools build: Use -fzero-init-padding-bits=all Leo Yan
2025-04-22 7:58 ` Leo Yan [this message]
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=20250422075826.GA28953@e132581.arm.com \
--to=leo.yan@arm.com \
--cc=acme@kernel.org \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=justinstitt@google.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=namhyung@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox