Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 Feb 2002 16:07:58 +0000
From:      Mark Murray <mark@grondar.za>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Mark Murray <markm@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/sys socket.h types.h 
Message-ID:  <200202031608.g13G83E47024@greenpeace.grondar.org>
In-Reply-To: <20020203230517.L19026-100000@gamplex.bde.org> ; from Bruce Evans <bde@zeta.org.au>  "Mon, 04 Feb 2002 00:06:49 %2B1100."
References:  <20020203230517.L19026-100000@gamplex.bde.org> 

next in thread | previous in thread | raw e-mail | index | archive | help

Ok, So what needs to be done?

M

> On Sun, 3 Feb 2002, Mark Murray wrote:
> 
> > markm       2002/02/03 03:36:59 PST
> >
> >   Modified files:
> >     sys/sys              socket.h types.h
> >   Log:
> >   Zero functional difference; make some integer constants unsigned, as
> >   they are used in unsigned context. This shuts lint(1) up in a few
> >   significant ways with "signed/unsigned" arithmetic warnings.
> >
> >   Revision  Changes    Path
> >   1.58      +2 -2      src/sys/sys/socket.h
> >   1.50      +3 -3      src/sys/sys/types.h
> 
> The change to howmany() is not good.  It changes the functionality of
> howmany() on negative values.  howmany() never worked right on negative
> values, so this is not very important.  More importantly, the change
> causes sign mismatches and brokenness where there was none before, e.g.,
> for
> 
> 	const int x = 0;
> 
> 	assert(howmany(x, 1) - 1 < 0);
> 
> Also, the change usually doesn't fix the warning for
> 
> 	const long long x = 0;
> 	const unsigned long long y = 0;
> 
> 	assert(howmany(x, 1) == y);
> 
> since 1U is usually promoted to 1LL in the changed howmany().
> 
> Bruce
> 
-- 
o       Mark Murray
\_      FreeBSD Services Limited
O.\_    Warning: this .sig is umop ap!sdn

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202031608.g13G83E47024>