[TUHS] origins of void*

arnold at skeeve.com arnold at skeeve.com
Sun Nov 5 20:06:10 AEST 2017


Paul Ruizendaal <pnr at planet.nl> wrote:

> I’m trying to understand the origins of void pointers in C. I think
> they first appeared formally in the C89 spec, but may have existed in
> earlier compilers.

void was added after the publication of the first edition of K&R, in
the V7 time frame. The 4.x compilers had support for void pointers and
functions returning void. Also added around the same time was structure
assignment and the ability to pass and return structs by value (although
this was little used).

> In the 4BSD era there was caddr_t, which I think was used for pretty
> much the same purposes.

Only for kernel code. I am pretty sure caddr_t wasn't used in user-land code.

HTH,

Arnold



More information about the TUHS mailing list