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

From: Helge Hafting (helgehaf@idb.hist.no)
Date: Mon Nov 27 2000 - 05:03:05 EST


Andries Brouwer wrote:
>
> On Sun, Nov 26, 2000 at 09:11:18AM +1100, Herbert Xu wrote:
>
> > No information is lost.
>
> 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.

Seems to me few other people think that way, thats why it is so
har for them to get. And thats why this style of coding isn't very
helpful either. It may be a real help for you, but not for others
who merely get confused or irritated at the small but easy to eliminate
micro-bloat.

There are certainly people so used to the implicit zeroing that they
think of "static int a;" as a zero initialization as explicit as
anything, because that's the way the language works. And they will
take just as much care if the "a-using" code is modified to run twice.
The "=0" part don't make it clearer for them if it was clear already.

Helge Hafting
-
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:17 EST