Subject: Re: caddr_t removal Q
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: tech-kern
Date: 03/13/2007 18:05:45
In article <20070313173252.GY2880@canolog.ninthwonder.com>,
Allen Briggs  <briggs@netbsd.org> wrote:
>I was wondering if anyone could enlighten me as to why caddr_t had to
>die.  I didn't notice any discussion of it--if there was some, please
>point me to the appropriate mailing list.
>
>It seems to have taken a number of people a fair bit of time to pick up
>the pieces from the change and it seems possible that some of the fixes
>could be wrong.
>
>What's wrong with having a generic pointer type that it's safe to do
>byte-wise arithmetic on (which is what I've considered caddr_t to be)?
>

That is the problem "char *" (caddr_t) is not a generic pointer. The API's
that wanted generic pointers should have had "void *" not "caddr_t".
"caddr_t" predates "void" in `c', so back then it was used as a generic
pointer for the lack of something better. Now we have something better
and we should be using it.

christos