Zero Initialized in BSS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've read kernel-hacking documentation that says you should never initialize any member of a static struct to zero because it's already zero from being in the BSS and if you initialize it, it gets pulled back into the main data segment.

But the current GCC documentation states that the -fzero-initialized-in-bss flag is on by default, with or without optimization, and I haven't found -fno-zero-initialized-in-bss in the build rules. So if a variable being initialized brings it back into data, being initialized to zero should put it right back into bss.

So do we really need to avoid zero initialization with the modern GCC, since the kernel source implicitly allows GCC-only extensions anyway?

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux