Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!brl-adm!brl-smoke!smoke!rbj@icst-cmr From: rbj@icst-cmr (Root Boy Jim) Newsgroups: net.lang.c Subject: Re: Questions about C on a Prime (primix) Message-ID: <2473@brl-smoke.ARPA> Date: Tue, 8-Apr-86 18:36:29 EST Article-I.D.: brl-smok.2473 Posted: Tue Apr 8 18:36:29 1986 Date-Received: Thu, 10-Apr-86 08:28:07 EST Sender: news@brl-smoke.ARPA Lines: 27 Any C implementation that insists on having the high bit set for normal character (char)s should also treat (char) as (unsigned char), or else there will be sign-propagation constants when (char)s are widened to (int). Otherwise, this is a permissible (although unusual) implementation choice. Both K&R & the ANSI standard say that a printing character is guaranteed to be positive. If the implementation (hardware) insists on characters with the high order bit set, then my guess is that it must be done in very low level code, possibly within putc just before the char is sent to the device. Varian 620i (sounds like a BMW) aka V-7x's wanted this as I seem to recall. In any case, the following program must print `positive', for any printing character 'x'. main() { char c; c = 'x' if (c > 0) printf("positive\n"); else printf("netative\n"); } References: K&R page 183 sect 6.1 (4/30/85) ANSI page 16 sect C.1.2.5