Date: Mon, 4 Feb 2002 00:06:49 +1100 (EST) From: Bruce Evans <bde@zeta.org.au> To: Mark Murray <markm@FreeBSD.org> Cc: <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org> Subject: Re: cvs commit: src/sys/sys socket.h types.h Message-ID: <20020203230517.L19026-100000@gamplex.bde.org> In-Reply-To: <200202031136.g13Bax289770@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 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?20020203230517.L19026-100000>