lkml.org 
[lkml]   [2000]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Zero initialisers again
Date
From
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/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.037 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site