Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcnc!gatech!rutgers!husc6!cca!mirror!ima!haddock!karl From: karl@haddock.UUCP (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: enum - enum ? Message-ID: <629@haddock.UUCP> Date: Fri, 26-Jun-87 13:01:43 EDT Article-I.D.: haddock.629 Posted: Fri Jun 26 13:01:43 1987 Date-Received: Sat, 27-Jun-87 09:54:37 EDT References: <139@starfire.UUCP> <516@haddock.UUCP> <20540@sun.uucp> <525@haddock.UUCP> <818@mcgill-vision.UUCP> Reply-To: karl@haddock.ISC.COM.UUCP (Karl Heuer) Organization: Interactive Systems, Boston Lines: 24 In article <818@mcgill-vision.UUCP> mcgill-vision!mouse (der Mouse) writes: >In article <525@haddock.UUCP>, karl@haddock.UUCP (Karl Heuer) writes: >> Perhaps you're right; the May86 dpANS lists under Common Warnings: "A >> value is given to an object of an enumeration type other than by >> assignment of an enumeration constant that is a member of that type." > >For example, [ x=RED is OK, but y=x is not ]. Good heavens. > >> (Which seems unusually strict, as it would produce a warning for some >> perfectly valid code written under the "strong enum" model.) > >I certainly see what you mean. I hope they come to their senses. The Oct86 dpANS (which I did not have at hand when I posted earlier) has changed this to "constant or variable". Better, but I'm still not sure whether this is sufficient -- It still seems to allow a warning for x=y[i] or x=z(). (But "i=x", which is equally illegal under the strong model, is not listed as a Common Warning. Hmm.) Of course, A.5 is not part of the Standard itself, and so should not be considered binding. In practice, I expect the compiler-writers will use common sense in this regard. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint