Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cca!mirror!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Comparing chars to constants Message-ID: <1477@haddock.ISC.COM> Date: Fri, 23-Oct-87 10:52:57 EST Article-I.D.: haddock.1477 Posted: Fri Oct 23 10:52:57 1987 Date-Received: Sun, 25-Oct-87 16:06:19 EST References: <4663@elroy.Jpl.Nasa.Gov> <7373@alice.UUCP> <1261@csib.UUCP> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 8 In article <1261@csib.UUCP> jwhitnel@csib.UUCP (Jerry Whitnell) writes: >The preferred technique is ( ( (int) c ) & 0xff ) == 0x80 This assumes that char is 8 bits. (Though the use of "0x80" may already be making that assumption.) I'd go with "c == (char)0x80", and if the compiler can't handle it, send in a bug report and/or change vendors. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint