[TUHS] origins of void*

Paul Ruizendaal pnr at planet.nl
Mon Nov 6 06:44:07 AEST 2017


Many thanks all for the replies, most enlightening.

I’ve examined the compiler sources for recognising ‘void’ as a keyword in the lexer, as far as available on the TUHS Unix Tree web pages.

For the PDP11 with pcc the results are that void is not present in V7, but is in SysIII. That is consistent with it being first implemented in 1979 on Unix/TS, and just missing the V7 release. As to the Ritchie compiler, void only first appears in SysV in 1983 (it is not in 2.9BSD). For the VAX it is not in 32V and 3BSD, but it is in 4BSD.

So it would seem that void pointers were available to the wider world (including BSD) from the summer of 1980 onwards.

>> 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.

Ah, thanks for pointing that out, I had not realised that and it helps explain some things. But why wasn’t caddr_t used for user-land code: usage in the signature of e.g. write() would have made sense, right?

In 4.1x BSD the definition of caddr_t remains 'char *', not 'void *’. Was there a special reason for that, or was that simply inertia from what it was in the V7 source?

Paul



More information about the TUHS mailing list