Subject: Re: misc/3132: lack of unistd.h
To: None <netbsd-bugs@NetBSD.ORG>
From: der Mouse <mouse@Holo.Rodents.Montreal.QC.CA>
List: netbsd-bugs
Date: 01/23/1997 16:27:53
>> [brk and sbrk, types]

> ANSI C allows for a 'void *' type; however, caddr_t (as char *)
> exists to allow both K&R C and ANSI C to compile properly.  K&R C
> doesn't know what void * is,

(thoguh to be fair, a lot of pre-ANSI and otherwise-K&R compilers do)

> but in both K&R and ANSI C, char * can be treated as a generic
> pointer.

Well, not quite; char * doesn't get the automatic conversion without
cast rules that void * does.

I think it's like this:

char *foo(int);
struct blop *x;
x = foo(10); /* warning permitted, maybe "at least one diagnostic" required */

but

void *foo(int);
struct blop *x;
x = foo(10); /* correct, must be silently accepted as if cast were there */

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B