[TUHS] origins of void*
clemc at ccc.com
Mon Nov 6 03:53:35 AEST 2017
Correct. When void came into C, full typing was already there; so void * was a part and it was first exploited because of the useful property of the return. The ptr properties became more and more important as its power was realized.
FYI. K&R was written before V7 was released and matched the Typesetter C compiler for V6 more than the later compiler released in V7. i.e. A slightly more mature version compiler was included in UNIX/TS which was what Bourne used as the V7 ‘project manager’ (Steve had a couple interesting stories about the later process). By that point in time void had been added as formal type to the language.
As since Bourne had been the driver for void it is not surprising that he picked up a version of the compiler that he thought was important. Thus as was noted it meant the book and released compiler were not in sync.
Sent from my PDP-7 Running UNIX V0 expect things to be almost but not quite.
> On Nov 5, 2017, at 7:14 AM, Warner Losh <imp at bsdimp.com> wrote:
> void functions certainly were much more widely used before void *, but void * worked on all the compilers I ever used. I'm a relative newcomer, though, since the first C compiler I used was on a VAX running 4.2BSD...
>> On Sun, Nov 5, 2017 at 6:20 AM, Ron Natalie <ron at ronnatalie.com> wrote:
>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the TUHS