Re: [PATCH] removal of "static foo = 0"

From: Albert D. Cahalan (acahalan@cs.uml.edu)
Date: Mon Nov 27 2000 - 15:33:42 EST


Andries Brouwer writes:

> Do I explain things so badly? Let me try again.
> The difference between
>
> static int a;
>
> and
>
> static int a = 0;
>
> is the " = 0". The compiler may well generate the same code,
> but I am not talking about the compiler. I am talking about
> the programmer. This " = 0" means (to me, the programmer)
> that the correctness of my program depends on this initialization.
> Its absense means (to me) that it does not matter what initial
> value the variable has.

It is too late to fix things now. It would have been good to
have the compiler put explicitly zeroed data in a segment that
isn't shared with non-zero or uninitialized data, so that the
uninitialized data could be set to 0xfff00fff to catch bugs.
It would take much effort over many years to make that work.

I'd rather see the compiler optimize for cache line use and
make use of small address offsets to load variables.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Nov 30 2000 - 21:00:18 EST