From owner-cvs-all Thu Oct 24 1:44:54 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A086E37B401; Thu, 24 Oct 2002 01:44:53 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 704AE43E3B; Thu, 24 Oct 2002 01:44:52 -0700 (PDT) (envelope-from bde@zeta.org.au) 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 SAA13290; Thu, 24 Oct 2002 18:44:43 +1000 Date: Thu, 24 Oct 2002 18:55:48 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Mark Murray Cc: cvs-committers@FreeBSD.org, Subject: Re: cvs commit: src/include stdlib.h src/lib/libc/gen getbsize.3 getbsize.c In-Reply-To: <200210240728.g9O7SMks053728@grimreaper.grondar.org> Message-ID: <20021024184126.F959-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 Thu, 24 Oct 2002, Mark Murray wrote: > > Of course not. We need to back out this change. > > > > Another reason to back it out is that it is just wrong. The header length > > is not a size but a field width that needs to be passed to printf via %*. > > "That is sometimes passed to %*". The rest of the time its not used or is a > happier as a size_t. The only purpose of this value is to pass it to printf via %* so that values get lined up with the header. Some callers only care about the value of the block size, so they don't use the header or its length. In no cases are the callers happier with a size_t. Returning the header length indirectly is actually less then useful, at least if a wrong type is returned. The length is just strlen(getbsize(...)). Callers that want it with a wrong type can get it directly by calling strlen(). Callers that don't want it have to provided a dummy variable to discard it in. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message