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: cvs commit: apache/src mod_proxy.c (fwd)
Date Wed, 03 Jul 1996 15:07:43 GMT
Jim Jagielski wrote:
> 
> Ben Laurie wrote:
> > 
> > Nah. An assignment from char * to const char * is legal. Vice versa is not.
> > 
> 
> Hmmm... I seem to recall that const could be initialized (once, of
> course) but never reassigned later. Thus,
> 
> 	const char *p = "Howdy";
> 
> is OK, but
> 
> 	const char *p;
> 	p = "Howdy";
> 
> most probably ain't.

Hmmm ... K&R is actually silent on this point (to my surprise). The ANSI
standard may not be but I'm not sure where my (rather out of date) copy is...

So, even though, IMO, char *->const char * is legal, I can't find a rule that
says so.

In my defence, I should add that C++ explicitly defines it to be legal...

Cheers,

Ben.

> 
> There are a few places in the proxy module that uses 'const' in the 2nd
> way (and were it looks like 'const' may not be required) but -Wall never
> complained about 'em. Chuck's latest commit "fixed" the one that started
> this, but what about the others?
> 
> -- 
> Jim Jagielski  << jim@jaguNET.com >>   |      "That's a Smith & Wesson,
>   **  jaguNET Access Services  **      |       and you've had your six" 
>       Email: info@jaguNET.com          |             - James Bond
> ++    http://www.jaguNET.com/         +++      Voice/Fax: 410-931-3157       ++

-- 
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