[PATCH v2] build: force gcc to initialize padding bits
    Bruce Richardson 
    bruce.richardson at intel.com
       
    Mon Jan 27 15:35:05 CET 2025
    
    
  
On Fri, Jan 24, 2025 at 10:26:48AM -0800, Stephen Hemminger 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>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
    
    
More information about the dev
mailing list