[PATCH] macintosh: no need to initilise statics to 0

Joe Perches joe at perches.com
Wed Aug 18 04:05:24 AEST 2021


On Tue, 2021-08-17 at 13:59 +0200, Christophe Leroy wrote:
> 
> Le 17/08/2021 à 13:51, Jason Wang a écrit :
> > Global static variables dont need to be initialised to 0. Because
> > the compiler will initilise them.
> 
> It is not the compiler, it is the Kernel. It is done here:
> 
> https://elixir.bootlin.com/linux/v5.14-rc6/source/arch/powerpc/kernel/early_32.c

I don't know why that's done generally.

>From memory, it's also required by the c spec unless it's for a union
where the first union member is smaller in size than other members.




More information about the Linuxppc-dev mailing list