Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mandrill!gatech!ncar!ames!ucsd!ucsdhub!esosun!seismo!uunet!unh!jeff
From: jeff@unh.UUCP (Jeffrey E. F. Friedl)
Newsgroups: comp.lang.c
Subject: Re: Puzzle on unsigned promotions
Summary: my dog did it
Message-ID: <571@unh.UUCP>
Date: 4 Jul 88 04:04:31 GMT
References: <736@vsi.UUCP> <12251@mimsy.UUCP> <565@unh.UUCP> <12291@mimsy.UUCP>
Distribution: comp
Organization: University of New Hampshire, Durham, NH
Lines: 30

In article <12291@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes:
> In article <565@unh.UUCP> I wrote:
> >... 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.
> >... The main problem is K&R's use of terms and fonts.
> 
> No, actually, the main problem is that K&R C has only one unsigned
> type, namely unsigned int.  Unsigned short, unsigned char, and unsigned
> long do not exist in K&R 1st ed.

Ahhhh.  I always knew I should try to get a copy of page 193.
Years ago, my... uhh... dog (ya, that's it) ate it and I just sort
of forgot about it.....

Seeing my mistake for blaming K&R ("forgive me, for I have strayed"),
I ask if the answer to the original poster (friedl@vsi) about what
is "correct" with "unsigned short", etc, is to say
    "whatever the compiler writer wanted to do, because it's not
     standard C anyway"
(where "standard" refers to K&R-I, not what X3J11 is doing)?

Perhaps the best thing to say about "unsigned short" is
"don't do it" (ANSI C coming our way not withstanding)?

	*jeff*

-------------------------------------------------------------------------------
Jeffrey Eric Francis Friedl, Box 2146 Babcock House, Durham New Hampshire 03824
..!{uunet,decvax}!unh!jeff   BITNET%"j_friedl@unhh"  ..!ucbvax!kentvax!jfriedl