[TUHS] origins of void*

Ron Natalie ron at ronnatalie.com
Sun Nov 5 23:20:42 AEST 2017


Yes.  Correct me if I’m wrong, but I recall functions returning void came before void*. 

Sent from my iPhone

> On Nov 5, 2017, at 5:06 AM, arnold at skeeve.com wrote:
> 
> 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