httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@leland.Stanford.EDU>
Subject Re: [Fwd: Problem 2534]
Date Mon, 03 Aug 1998 23:38:58 GMT
On Mon, 3 Aug 1998, Dean Gaudet wrote:

> > Waitaminute. If this was *foo and *bar, then I could buy this; it makes
> > sense. But foo[] and bar[] are supposed to allocate arrays on the stack
> > (six bytes each), and are supposedly writeable. Any compiler that makes
> > foo == bar is severely wrong, IMHO. Unless you're allowing your optimizing
> > compiler to play with your stack arrangement, and it should only do that
> > in this case if it's absofragginglutely sure you're not modifying either
> > foo or bar. Which isn't a case covered by the ANSI/ISO spec. 
> Actually I believe that ANSI requires all globals to have unique addresses,
> so they couldn't be combined.

Right. That's what I said. But since they're static, the compiler could
theoretically examine the whole file, see that no one was writing to them,
and combine them. It might not be completely street-legal, but since no
one outside the file can access the variables, no one would notice.

That's all I meant. I don't think any compilers actually do this, but I
know very little about compilers.

-- Alexei Kosut <> <>
   Stanford University, Class of 2001 * Apache <> *

View raw message