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

Russell King
2000-11-29T10:17:19Z

Albert D. Cahalan writes:
> Oh, bullshit. We break the C standard left and right already.
> This is the kernel, and the kernel can initialize BSS any damn
> way it feels like initializing it. The kernel isn't ever going
> to be standard C.
>
> Choosing an initializer that tends to catch unintended reliance
> on zeroed data would be good. Too bad it is too late to fix.

Its not me talking bullshit here, its you. It is totally reasonable
to rely on:

static int foo;

to be zero. If it is not, that is a bug in the C startup code. No
two ways about it. If someone then says "I want to initialise the
BSS to some magic value to catch this reliance" then we are breaking
a lot of peoples expectations. (Least Surprise theory)

To say again, relying on foo to be zero is not a bug.

If you set the BSS to something non-zero, we already know that a lot
will break. But it will break because someone has broken the BSS
initialisation code, not because it is relying on something that is
expected to be standard. By setting the BSS to something non-zero,
you're not telling anyone anything new. About the only response
will be "fix the BSS initialisation".

If you want to try this, then that is up to you. Don't let us
stop you. However, don't expect people to accept patches to
"fix" your self-created problem.

I look forward to your complaints about the disk subsystems,
keyboard, console, and so forth apparantly being broken.
_____
|_____| ------------------------------------------------- ---+---+-
| | Russell King rmk@arm.linux.org.uk --- ---
| | | | http://www.arm.linux.org.uk/personal/aboutme.html / / |
| +-+-+ --- -+-
/ | THE developer of ARM Linux |+| /|\
/ | | | --- |
+-+-+ ------------------------------------------------- /\\\ |