Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!sdcsvax!ucbvax!hplabs!sdcrdcf!ism780c!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: enum Message-ID: <1314@haddock.ISC.COM> Date: Mon, 5-Oct-87 12:52:30 EDT Article-I.D.: haddock.1314 Posted: Mon Oct 5 12:52:30 1987 Date-Received: Fri, 9-Oct-87 00:42:31 EDT References: <1177@laidbak.UUCP> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 12 In article <1177@laidbak.UUCP> daveb@laidbak.UUCP (Dave Burton) writes: >[Attempt to use relational operators on enums produces warning] I just had the same thing happen to me. I was somewhat surprised that lint complained, because I've always considered that to be a valid operation even in the strict-enum model. My workaround was to write a macro #define enum_foo_lt(x,y) ((int)(x) < (int)y) , but I dislike this because it doesn't typecheck the arguments (it will now let me compare an enum foo with an int, which *should* be illegal in this model). Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint