Re: Zero initialisers again

From: Horst von Brand (vonbrand@sleipnir.valparaiso.cl)
Date: Sat Aug 12 2000 - 21:43:32 EST


kuznet@ms2.inr.ac.ru said:
> In-Reply-To: <200008121842.TAA11905@flint.arm.linux.org.uk> from "Russell King"
> *** at Aug 12, 0 11:15:00 pm
> > +int sysctl_tcp_stdurg = 0;
> > +int sysctl_tcp_rfc1337 = 0;

> > We no longer need to explicitly initialise any variable to zero. Why is
> > this change required?

> Well... simply because all the rest of variables in this file
> are initialised.

Initialized variables (even explicitly initialized to zero) still go into
the data segment, which shows up in the executable file intact. This just
increases the size of the kernel file (not the running kernel's memory use)
for no reason I can see.

> Imagine that it is not 0, but DEFAULT_TCP_STDURG, defined to some value,
> which occasionally turned out to be zero. 8)

Not initializing in that case is a bug, yes. This just papers over it, and
makes it _harder_ to find the bug if the #define someday changes (it is
easier to realize that the initialization is missing than to figure out
_why_ it is wrong).

-- 
Horst von Brand                             vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Vin~a del Mar, Chile                               +56 32 672616

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Aug 15 2000 - 21:00:29 EST