Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site unc.UUCP
Path: utzoo!watmath!clyde!floyd!harpo!decvax!mcnc!unc!tim
From: tim@unc.UUCP (Tim Maroney)
Newsgroups: net.lang.c
Subject: Re: typedef in c (recursive structs)
Message-ID: <6889@unc.UUCP>
Date: Thu, 8-Mar-84 13:42:39 EST
Article-I.D.: unc.6889
Posted: Thu Mar  8 13:42:39 1984
Date-Received: Sat, 10-Mar-84 08:46:29 EST
References: <555@genix.UUCP>
Organization: CS Dept., U. of N. Carolina at Chapel Hill
Lines: 25

I agree that it is too difficult to create recursive structs with a typedef
in C.  That extra tag that you have to create is a pain:

(1) when you're writing C yourself (a phenomenon called "straining
programmer creativity")

(2) when you're automatically generating C code (for example, for an IDL
interface -- you want the generator to be as simple as possible)

(3) when you're reading someone else's C code (having two different
constructions that mean exactly the same thing is always a bitch)

It would be much better if the C compiler would defer creating an error in a
typedef for an unknown identifier used as a type, until the types declared
in the typedef are known, and perform a fixup then.  Unfortunately, this
would be fairly difficuly to implement in pcc, since it treats identifiers
and typedef names as separate sorts of tokens.  Still, that should not be
the sort of consideration that shapes a language.
--
Tim Maroney, University of North Carolina at Chapel Hill
mcnc!unc!tim (USENET), tim.unc@csnet-relay (ARPA)

The opinions in this article are entirely my own, and should not be
construed as representing the policy of UNC or the opinions of my employers,
nor of the race of wombats or any other burrowing quadruped.