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

Peter Samuelson
2000-11-29T14:32:13Z

[Tigran Aivazian <tigran@veritas.com>]
> no, I was not talking about ISO C standards but about the normal
> expected C environment under any UNIX. I guess, we just mean
> different things by "trivially equivalent" since neither of us said
> anything about what that actually meant. What I meant by that was
> "not only imply the same logic for the program but correspond to the
> same physical locations (if any) on the resulting object file".

OK, so we do mean two different things. As far as standard C is
concerned, the location of your global variables is none of your
business, as long as they can be addressed with a pointer of the
appropriate type. By the time you get to caring about what section
something goes in, you're way beyond standard C, and you need to start
looking at the gcc __attribute__(("section")) extension, and possibly
an ld link script.

So I guess to me "trivially equivalent" meant that a standards-
conforming C program would never notice the difference. As such, I
think -fassume-bss-zero would be an entirely reasonable default for a C
compiler, just as reasonable as reordering globals within a section
(and nobody seems to be questioning gcc's right to do *that*).

It would probably also be reasonable to document it and provide an
option to switch it off.

Peter