Kris Kennaway <[EMAIL PROTECTED]> writes:
> David E. O'Brien <[EMAIL PROTECTED]> writes:
> > [...]
> >   MFC: Eradicate caddr_t from the VFS API.
> Does this change the KAPI on a stable branch?

No, it changes neither the API nor the ABI.  It replaces caddr_t (which
is typedef'd to char *) with void *, and those two are compatible types.

The following program demonstrates this:

#include <sys/types.h>
void *f1(void *arg) { return arg; }
caddr_t f2(caddr_t arg) { return arg; }
int main(void) { caddr_t ca; void *vp; ca = f1(ca); ca = f1(vp); vp = f2(ca); 
vp = f2(vp); return 0; }

Compile it with 'cc -Wall -Wextra -pedantic -o /dev/null caddr_t.c'

The program tests both passing a caddr_t in to a function that expects
void * and returning a void * to a caller that expects caddr_t, which
are two of the three cases that might break (for completeness, it also
tests the reverse, which isn't actually relevant here).

The third case, which the program doesn't test, is the case where the
type of a member of a struct that is exposed through the API changes;
that would indeed change the API, because the caller might want to
perform pointer arithmetic on that member.

However, the patch does none of these things.  It only changes internal
use of caddr_t, and the type of some API function arguments - no return
types, no structure members - so it's completely safe.

To tell you the truth, I'm surprised this wasn't MFCed earlier...
Thanks, David :)

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to