Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!prls!pyramid!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.lang.c Subject: Re: problems with the C parser Message-ID: <3828@sun.uucp> Date: Fri, 30-May-86 13:14:42 EDT Article-I.D.: sun.3828 Posted: Fri May 30 13:14:42 1986 Date-Received: Sun, 1-Jun-86 07:06:46 EDT References: <5072@topaz.RUTGERS.EDU> Organization: Sun Microsystems, Inc. Lines: 28 > typedef union { > int intfield; /* change the record name - keyword */ > struct bool{unsigned x[32]:1}; > } newtype; > > > The C parser barfed all over this. Well, actually, the parser had no trouble with it whatsoever. Some routines that do semantic checking on declarations complained about it. There are plenty of constructs in C which are syntactically valid but not legal C. > I wanted an integer that I could index into by bit... You can't. Read K&R again, only look at more than just the syntax specifications. At the top of page 197: ...In all implementations, there are no arrays of fields... Like it or not, that's the case. It may not be easy to convert your program to use masks, but if you want to convert it to C you have no choice. There *is* a Pascal on Suns, although I don't know if your program uses features specific to VAX(/VMS, I presume) Pascal, which the Berkeley Pascal which Sun offers probably doesn't have. -- Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.arpa