[PATCH v2] build: force gcc to initialize padding bits

David Marchand david.marchand at redhat.com
Tue Feb 11 12:06:00 CET 2025


On Fri, Jan 24, 2025 at 7:27 PM Stephen Hemminger
<stephen at networkplumber.org> wrote:
>
> 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 of all fields to zero.
>
> Note: other compilers always initialize to zero in these cases.
> Only GCC seems to have decided to start initializing less as
> a silly attempt at optimization.
>
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> Acked-by: Morten Brørup <mb at smartsharesystems.com>

Applied, thanks.


-- 
David Marchand



More information about the dev mailing list