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: WWW Form Bug Report: "osf/1 virtualhost support by ip broken" on OSF/1
Date Wed, 13 Nov 1996 04:59:22 GMT
Roy T. Fielding wrote:
> 
> > I don't like that. If the manual says it returns -1 and the type is an
> > unsigned long, then the correct construction is surely:
> > 
> > (unsigned long)-1
> > 
> > ~0ul may happen to be the same, but that ain't what the manual says.
> 
> Well, my brain says that (unsigned long)-1 is undefined because there is
> no definition of -1 in unsigned numbers.  Sure, it may be defined by ANSI,
> but I don't have an ANSI brain.  :)

You are misreading it. (unsigned long)-1 doesn't say "an unsigned long with a
value of -1". It says "-1 converted to an unsigned long".

> In contrast, ones complement is very
> well defined for both signed and unsigned numbers.

True enough. But not defined to be equivalent in the way you want it to be.

> 
> I don't care either way, just so long as it works.
> 

Cheers,

Ben.

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

Mime
View raw message