httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <>
Subject Re: cvs commit: httpd-2.0/modules/http http_protocol.c
Date Thu, 11 Oct 2001 16:18:39 GMT
On Thu, 11 Oct 2001, Aaron Bannert wrote:

> I believe you are mistaken. It is an optimization of a compiler to try to
> preallocate the stack if it can determine the max stack size, but it can
> not always be determined until runtime:
> int main(int argc, char *argv[])
> {
>     int i;
>     for (i = 0; i < argc; i++) {
>         int j[argc];

Well, that's obviously different than the case we're talking about here,
which has a pre-determined, fixed length.

We do this sort of thing _everywhere_ in the code.  We have to assume at
least a thing or two about the compiler being non-stupid.  But even if it
is stupid, tighter scoping of temporary variables like this from time to
time (a) makes it easier to find the declaration of the thing, especially
in a long function and (b)  keeps you from fscking up and stepping on
yourself later.

I'm with Greg.


   Cliff Woolley
   Charlottesville, VA

View raw message