Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Oct 2002 18:55:48 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Mark Murray <mark@grondar.za>
Cc:        cvs-committers@FreeBSD.org, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/include stdlib.h src/lib/libc/gen getbsize.3 getbsize.c 
Message-ID:  <20021024184126.F959-100000@gamplex.bde.org>
In-Reply-To: <200210240728.g9O7SMks053728@grimreaper.grondar.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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