From owner-cvs-all Mon Feb 4 5:42:23 2002 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id C32B337B417; Mon, 4 Feb 2002 05:42:08 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id AAA16927; Tue, 5 Feb 2002 00:42:00 +1100 Date: Tue, 5 Feb 2002 00:44:22 +1100 (EST) From: Bruce Evans X-X-Sender: To: Mark Murray Cc: Mark Murray , , Subject: Re: cvs commit: src/sys/sys socket.h types.h In-Reply-To: <200202031724.g13HOwE61969@greenpeace.grondar.org> Message-ID: <20020205002930.K22843-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 3 Feb 2002, Mark Murray wrote: > > On Sun, 3 Feb 2002, Mark Murray wrote: > > > > > Ok, So what needs to be done? > > > > Back out the change to howmany(). The caller can always pass it types > > with the same signedness (after promotion) or cast the value. This > > is a bit like the caller having to do this for min(9undoc): > > min(1U, -1) gives a very wrong value. min(1U, 1) gives the correct > > value but may only escape being warned about because the args get > > silently converted to u_int. > > So how does one write a (decent) macro to return a correct value > for min(1u, -1)? One doesn't. One can write fairly indecent ones using Gnu C, but FreeBSD currently uses min functions instead of the MIN macro in the kernel. > howmany() is used so much in the kernel, and is defined in multiple > places, so methinks it needs to be a function (inline?). It kicks > out zillions of wanings when you try to lint it. The warnings are probably correct. They probably indicate that callers are passing mismatched arg types. Perhaps more seriously, the change to the type of NBBY exposes an old bug in ffs and causes kernel panics. See another thread. Please back it out too, and consider doing the same for all the other type changes. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message