[PATCH] build: force gcc to initialize padding bits
Stephen Hemminger
stephen at networkplumber.org
Fri Jan 24 19:37:48 CET 2025
On Fri, 24 Jan 2025 09:38:20 +0000
Bruce Richardson <bruce.richardson at intel.com> wrote:
> >
>
> Does this flag give us additional guarantees of padding being
> zero-initialized that were there before? From my reading of the gcc doc[1],
> "..padding-bits=union" corresponds to the old behaviour, right?
>
> This also means we will have different padding behaviour on clang and gcc,
> since clang (at least v18 on my board) doesn't support this flag. Do we see
> any issues with that?
>
> /Bruce
I chose the setting based on some email with the Linux kernel hardening
project and their choice.
Clang decided to fix and just do the right thing.
https://github.com/llvm/llvm-project/commit/7a086e1b2dc05f54afae3591614feede727601fa
More information about the dev
mailing list