Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site umcp-cs.UUCP Path: utzoo!watmath!clyde!akgua!mcnc!decvax!harpo!ihnp4!houxm!hogpc!houti!ariel!vax135!floyd!cmcl2!seismo!rlgvax!cvl!umcp-cs!chris From: chris@umcp-cs.UUCP Newsgroups: net.lang.c Subject: Re: adjectives for typedef'd names Message-ID: <7013@umcp-cs.UUCP> Date: Fri, 11-May-84 21:22:59 EDT Article-I.D.: umcp-cs.7013 Posted: Fri May 11 21:22:59 1984 Date-Received: Sun, 13-May-84 10:03:31 EDT References: <1204@proper.UUCP> Organization: Univ. of Maryland, Computer Science Dept. Lines: 26 Keywords: typedef grammar LR(1) PCC happens to treat ``typedef''ed names exactly the same as the thing to which they are typed. (At least, if you say typedef int foo; main () { register unsigned foo i; short foo; ... } you get one ``register unsigned int'' and no ``short int''s.) I prefer this, because this is the way I think of them. In fact I used to get the order of ``typedef'' backwards, because I thought of them as ``glorified #define's''. (The one advantage they have over #define's is that they can make things syntactically simpler, e.g., typedef int (*pfun)(); /* pointer to function returning int */ pfun table[] = { ... }; /* a table of pointers to functions */ .) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland