Puzzle on unsigned promotions

Peter da Silva peter at ficc.UUCP
Wed Jul 6 02:54:46 AEST 1988


In article <565 at unh.UUCP>, jeff at unh.UUCP (Jeffrey E. F. Friedl) writes:
> Here's (I think) the problem (I'm being a devil's advocate here.. keep
> the flame level low while you read)....  I would *love* to be proven
> wrong on this, but no where in K&R-I can I find where it specifically
> stipulates that the conversion from unsigned short to a larger unsigned
> int is done by zero padding and not sign (sign with an unsigned?) extending.

Last I looked, K&R never refer to "unsigned long" or "unsigned short".
In fact I don't think that unsigned was a modifier back then... it was
a type.

I guess that's why K&R never brings that up...
-- 
-- `-_-' Peter (have you hugged your wolf today) da Silva.
--   U   Ferranti International Controls Corporation.
-- Phone: 713-274-5180. CI$: 70216,1076. ICBM: 29 37 N / 95 36 W.
-- UUCP: {uunet,academ!uhnix1,bellcore!tness1}!sugar!ficc!peter.



More information about the Comp.lang.c mailing list