Re: [PATCH] removal of "static foo = 0" from drivers/ide (test11)

Russell King
2000-11-25T12:35:20Z

J . A . Magallon writes:
> ANSI rules for C say that uninitialized vars get a 0, but you can't trust
> on the ANSI behaviour of a compiler.

It has nothing to do with the compiler, but everything to do with the
C startup code. In the Linux kernel, we have complete control over the
C startup code - it is in arch/*/kernel/head.S.

The only way a compiler can break this is if it creates a new section
.bss_im_not_going_to_allow_anyone_to_initialise_this and places all
the variables in there. Hardly likely, don't you think?

The initialisation of .bss is a run-time issue, NOT a compiler issue.
_____
|_____| ------------------------------------------------- ---+---+-
| | Russell King rmk@arm.linux.org.uk --- ---
| | | | http://www.arm.linux.org.uk/personal/aboutme.html / / |
| +-+-+ --- -+-
/ | THE developer of ARM Linux |+| /|\
/ | | | --- |
+-+-+ ------------------------------------------------- /\\\ |