Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!uw-beaver!cornell!rochester!ur-tut!sunybcs!boulder!hao!ames!umd5!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: unsigned & char's Keywords: interpretation of type rules, signed char's, unsigned's Message-ID: <7006@brl-smoke.ARPA> Date: 9 Jan 88 09:01:15 GMT References: <1167@ark.cs.vu.nl> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 12 In article <1167@ark.cs.vu.nl> jcvw@cs.vu.nl (Winkel van Jan Christiaan) writes: >... Therefor I c use a typecast to an unsigned. ... >... I thought that the typecast made my wish clear to the compiler .. Typecasts are not wish indicators but rather actual type conversion operators. In an expression, frequently there is some "normalization" of operand types before they are operated on, and in your case this involves applying the "default integer promotions", which among other things widen the char to an int before the cast is applied. You can use an (unsigned char) cast; or better, simply use unsigned char data in the first place.