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

Helge Hafting
2000-11-27T10:33:29Z

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