httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject Re: b1 error?
Date Tue, 16 Apr 1996 06:15:52 GMT
> 
> On Mon, 15 Apr 1996, Garey Smiley wrote:
> 
> > Is anyone else getting the following error compiling Apache 1.1b1?
> >
> > gcc -c -O2 http_protocol.c
> > http_protocol.c: In function `rvputs':
> > http_protocol.c:765: `v' undeclared (first use this function)
> > http_protocol.c:765: (Each undeclared identifier is reported only once
> > http_protocol.c:765: for each function it appears in.)
> > make: *** [http_protocol.o] Error 1
> 
> Hmm. Compiles here, with nary a warning (even at -Wall), which is
> interesting, since v is indeed undeclared. Looking at the function,
> which start out with
> 
> int
> rvputs(request_rec *r, ...)
> {
>     va_list args;
> ...
>     va_start (args, r);
> ...
>         x = va_arg(args, const char *);
> 
> and ends up with
> 
>             va_end(v);
> ...
>     va_end(v);
> ...
> }
> 
> I think that the va_end(v) occurances should be replaced with
> va_end(args). It seems to work either way here. But I could be
> wrong. Can someone who knows more about varargs than I do comment on
> this?

You are right as to what the fix is. The explanation is simple ... on most
systems va_end() does nothing. That is, it is declared:

#define va_end(x)

On some systems va_end() sets its argument to NULL, hence the error.

Of course, this is stdargs not varargs...

Cheers,

Ben.

> 
> --
> ________________________________________________________________________
> Alexei Kosut <akosut@nueva.pvt.k12.ca.us>
> URL: http://www.nueva.pvt.k12.ca.us/~akosut/
> Lefler on IRC, DALnet <http://www.dal.net/>
> 

-- 
Ben Laurie                  Phone: +44 (181) 994 6435
Freelance Consultant and    Fax:   +44 (181) 994 6472
Technical Director          Email: ben@algroup.co.uk
A.L. Digital Ltd,           URL: http://www.algroup.co.uk
London, England.

Mime
View raw message