Xref: utzoo comp.lang.c:29994 comp.unix.ultrix:3840 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!decwrl!apple!snorkelwacker!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.lang.c,comp.unix.ultrix Subject: Re: enum handling by cc under ultrix V2 wrong? Message-ID: Date: 29 Jun 90 21:31:20 GMT References: <1990Jun29.175209.16251@watdragon.waterloo.edu> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 39 In-reply-to: tbray@watsol.waterloo.edu's message of 29 Jun 90 17:52:09 GMT In article <1990Jun29.175209.16251@watdragon.waterloo.edu> tbray@watsol.waterloo.edu (Tim Bray) writes: | Am porting a big application to a decsystem 3100 running ultrix V2.something; | the cc compiler complains about the following things: | | 1. The type 'void *' as a formal function parameter | 2. The type 'void *' as a member of a union within a structure | 3. Bitwise OR of enums (enum {e1, e2} foo; int set; set = e1 | e2;) | 4. Bitwise AND of enums (enum {e1, e2} foo; int set; set = e1 & e2;) | 5. enums as array indices (enum {e1, e2} foo; int x, y[3]; x = y[e1];) | | These all seem like gross violations of both common sense and of the ANSI | C standard as I read it in K&R V2. In particular, there seems no excuse | for the refusal to deal with enums as stated. | | Questions: | | 1. Am I insane, and the compiler correct? | 2. Wil moving up to the most recent v3.whatever of ultrix correct this? | | Apologies if this has been beaten to death here. If so, flames by mail | please. The Ultrix based MIPS compilers are not completely ANSI. Revision 1.31 in particular did not like void *. My spies tell me, revision 2.00 of the compiler suite will fix these problems, but I suspect the compiler has not been released in the V3 world, and is waiting for V4. With regard to enums, disallowing enums in normal integer operations without a cast was standard PCC (aka most UNIX systems) behavior. Both the relaxation of enums to be plain ints, and void * are features added in the ANSI standard, so older compilers may not yet support these features. -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA Do apple growers tell their kids money doesn't grow on bushes?