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:19:53 GMT
On Mon, 3 Aug 1998, Jim Jagielski wrote:

> Alexei Kosut wrote:
> > 
> > (Recall that arrays and pointers are not the same thing in C, no matter
> > how alike they may act)
> > 
> Yep... that's why I suggested changing the decalrations from [] to *
> for the "end_" variables in question... Mostly likely, this would make
> is clearer to the compiler what we mean.

Yes, this sounds like a good idea to me. While the array-to-pointer
conversions are well-defined (pointer = &array[0]), this just strikes me
as something that a compiler, especially a well-meaning optimizing
compiler, could screw up. While theoretically, a pointer to an array
should always give the same result, using a pointer directly ensures it,
hmm? (since there is actually a word in memory somewhere that actually
contains the pointer address, instead of it being calculated each time
it's needed)

+1, regardless of whether or not it solves the problem :)

I mean, heck, it would save a whole 77 bytes of memory per process!

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

View raw message