Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site x.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!cybvax0!frog!x!john From: john@x.UUCP (John Woods) Newsgroups: net.lang.c Subject: Re: ANSII C structures and unions Message-ID: <478@x.UUCP> Date: Thu, 25-Apr-85 12:30:58 EST Article-I.D.: x.478 Posted: Thu Apr 25 12:30:58 1985 Date-Received: Sat, 27-Apr-85 04:32:34 EST References: <126@drivax.UUCP> Distribution: net Organization: Charles River Data Systems, Framingham MA Lines: 35 > I noticed that the standard has defined structures and unions > in such a way as to break most of my code... > It didn't take me long to find anything that includes > stdio.h fails because of the structure problem. > The way I read the standard a structure must be declared as a template > with a tag before being used to declare a variable. For example: > struct pig { int a; int b; }; > struct pig hog; > Not like this: > struct { int a; int b; } hog; Looking over my draft copy of the C Information Bulletin, it looks like they still permit the old form. Quoting, C.5.2.1 Structure and union specifiers Syntax struct-or-union-specifier: struct-or-union identifier-sub-opt { struct-declaration-list } I.e., the identifier is optional. They go into detail about the semantics of your first version, but not about the second version. I guess they figured that those who use that style already understand it :-). My copy of proto-C standard is a bad photocopy of a pencil-marked version of the November 12, 1984 draft which was handed out at the February IEEE UNIX Standards Committee (P1003) meeting. Supposedly the pencil marks represented the delta to the next draft. What actually came out, I do not know. -- John Woods, Charles River Data Systems, Framingham MA, (617) 626-1101 ...!decvax!frog!john, ...!mit-eddie!jfw, jfw%mit-ccc@MIT-XX.ARPA You can't spell "vile" without "vi".