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

From: Peter Samuelson (peter@cadcamlab.org)
Date: Tue Nov 28 2000 - 22:21:50 EST


[Albert D. Cahalan]
> Choosing an initializer that tends to catch unintended reliance on
> zeroed data would be good. Too bad it is too late to fix.

Why would that be good? Why is it bad to accidentally rely on zeroed
data, if the data is in fact guaranteed to be zeroed? It's not like
this is going to change out from under us in a year. You said it
yourself: we can do whatever we want here. And I don't see why we
would ever want to do anything other than zero it.

> Go back and read the rest of this thread. Examples have been provided
> (not by me) of such code leading to latter mistakes.

Oh please, how hard can it be to type

  static int foo; // = 0

as opposed to

  static int foo = 0;

If the two produced the same object code, the second would be better,
but they don't, so it isn't. Patch gcc, if you care enough (and feel
you can convince the gcc steering committee to care enough).

Peter
-
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:21 EST