[TUHS] Question: stdio - Who invented and ...

scj at yaccman.com scj at yaccman.com
Mon May 11 11:00:27 AEST 2020

I can't help with enum.  It sticks in my mind that some other language 
had something similar but details are gone.
However, void was more interesting.   The original default return type 
for both B and C was int.  As part of doing lint, I started wondering 
whether it would be good to have a message "function returns a value 
that is unused".  In some cases, this would be a really useful message.  
That feature never made it into lint, but the idea persisted, and Dennis 
and I discussed void as a keyword to say "I'm not returning anything".  
It became useful as a message if you try to return a value from a 
function declared as void.

But the real brilliance, to my mind, was the invention of void *.  Larry 
Rosler and I were at a Usenix meeting together, and after a bit of 
alcoholic lubrication, I started complaining about trying to use malloc 
and also have strong typing.  Larry suddenly said -- "we need a pointer 
that can't be indirected through, but can be assigned to any other 
pointer!" and after a minute or so he said "void *.  We should call it 
void * ."

My memory is that Dennis was instantly enthusiastic and it was in PCC a 
day or two later.



On 2020-03-23 19:02, Greg A. Woods wrote:
> At Mon, 23 Mar 2020 09:46:52 -0400, Clem Cole <clemc at ccc.com> wrote:
> Subject: Re: [TUHS] Question: stdio - Who invented and ...
>> I've forgotten when 'enum' and 'void' got added (which are not in the 
>> white
>> book - Steve Johnson or Doug may remember).   But, I think they were 
>> in the
>> V7 compiler, and not Typesetter C.
> Since I was recently researching these myself:
> There was an extra page in the 7th Edition manual titled "Recent 
> Changes
> to C" which described both structure assignment and the enumeration
> type:
> 	https://www.bell-labs.com/usr/dmr/www/cchanges.pdf
> This paper appears in the UNIX System III "The C Programming Language
> Reference Manual", but there's no mention of "void" in that manual.  On
> the other hand the UNIX System III PDP-11 compiler mentions "void" 
> (1980).
> I don't see any mention of "void" in 7th Edition sources.  However the
> version of 'awk' on the v7addenda tape from "12/2/80" has one "(void)"
> cast.  The only mention of "void" in dmr's "The Development of the C
> Language" paper (from HOPL-II, 1993) seems to be in the
> "Standardization" section where it's mentioned that it's not described
> in the first edition of K&R.  There's mention in the CSTR#102 paper 
> from
> Sept. 1981 of the "void" type.  The 2.9BSD code uses "void", but the
> sources I have don't include a copy of the compiler.
> --
> 					Greg A. Woods <gwoods at acm.org>
> Kelowna, BC     +1 250 762-7675           RoboHack <woods at robohack.ca>
> Planix, Inc. <woods at planix.com>     Avoncote Farms <woods at avoncote.ca>

More information about the TUHS mailing list