Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!linus!genrad!mit-eddi!mit-vax!eagle!harpo!floyd!vax135!ukc!root44!pdl
From: pdl@root44.UUCP
Newsgroups: net.lang.c
Subject: Re: type casting problem
Message-ID: <3099@root44.UUCP>
Date: Fri, 10-Jun-83 12:24:53 EDT
Article-I.D.: root44.3099
Posted: Fri Jun 10 12:24:53 1983
Date-Received: Sat, 11-Jun-83 10:41:53 EDT
References: decvax.112
Lines: 12

The reason you get sign extension is because you `char's should be `unsigned char',
this solves the problem (the code shown converts a signed char to an unsigned
larger integer, so sign extension MAY occur (not that `char' may be signed
or unsigned at the whim of the compiler writer.)

I know of no compiler that disallows `unsigned char' these days,
so why not keep it simple (you don't need ANY casts, then !)

		Per ardua ad portability
			Dave Lukes

			...!vax135!ukc!root44!pdl