Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!topaz!harvard!ut-sally!utah-cs!utah-gr!donn From: donn@utah-gr.UUCP (Donn Seeley) Newsgroups: net.lang.c Subject: Re: Boolean datatypes (really about enum types and the PCC) Message-ID: <1743@utah-gr.UUCP> Date: Sun, 15-Jun-86 23:20:44 EDT Article-I.D.: utah-gr.1743 Posted: Sun Jun 15 23:20:44 1986 Date-Received: Tue, 17-Jun-86 11:19:30 EDT References: <210@pyuxv.UUCP> <4129@sun.uucp> Organization: University of Utah CS Dept Lines: 21 I was informed by Rob Pike not too long ago that at least at the Labs, enums are ints: enumeration constants are symbolic integer constants and enumeration variables are simply ints. Their compiler doesn't emit any 'enumeration type clash' warnings and performs proper integer operations on enums such as shifts (the BSD PCC won't permit shifts of enum variables). The proposed draft ANSI C standard doesn't seem to require that compilers treat enums as anything other than ints. If people are writing programs which employ enums strictly as ints, the utility of enums in type verification seems to be nil and compiler warnings will just be obnoxious. The situation with enums reflects the situation with typedefs in an odd way -- despite appearances, neither construct defines a 'new' type. As Guy Harris notes, enums are useful as replacements for preprocessor constants and can serve as a debugging aid for programs like 'dbx'. Given their limited application it's easy to see why they haven't caught on. Donn Seeley University of Utah CS Dept donn@utah-cs.arpa 40 46' 6"N 111 50' 34"W (801) 581-5668 decvax!utah-cs!donn