From mboxrd@z Thu Jan 1 00:00:00 1970 From: steve@quintile.net (Steve Simon) Date: Sun, 5 Nov 2017 18:29:12 +0000 Subject: [TUHS] origins of void* In-Reply-To: References: <33ABE931-7E70-4C99-B289-2D3F6BDA1EBE@planet.nl> <201711051006.vA5A6BO2032436@freefriends.org> Message-ID: <09628F7B-28C9-4F72-91E8-665AE5BF6425@quintile.net> I started out on Edition 7, this was the interdata / perkin elmer port of v7 (based on Richard Milker’s work at Wollongong with some bits of 2.4BSD added in (csh and vi i remember). i remember this having a modified v6 compiler which had the shared namespace fir all structure members (hence the stat.st_mtime and friends). but it also had structure assignment and enums. anyone know where this fits into the compiler evolution, or was it an evolutionary dead end? -Steve > On 5 Nov 2017, at 17:53, Clem cole wrote: > > 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 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... >> >> Warner >> >>> On Sun, Nov 5, 2017 at 6:20 AM, Ron Natalie 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 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... URL: