unsigned char -> unsigned int conversion

Morris Keesan keesan at bbncca.ARPA
Thu Jun 21 00:55:46 AEST 1984


------------------------------
> The C language does permit "unsigned short int" and "unsigned long int".
> The fact that one can say "unsigned short x;" or "unsigned long x;" on many
> compilers can be considered either a side-effect of the compilers being used,
>   . . .
> 	  Guy Harris

    WHICH C language?  The one defined in Kernighan and Ritchie doesn't; the
one defined in the System V Release 1 "Programming Guide" doesn't.  The only
C language DEFINITION I know of which allows unsigned shorts and longs is the
System V Release 2 C Language document.  The following excerpt posted recently
by Jim Balter of INTERACTIVE Systems (Thank you, Jim) clearly allows
"unsigned short int x", "unsigned long int x", "unsigned short x",
and "unsigned long x".

    At most one of the words long or short may be specified in conjunction
    with int; the meaning is the same as if int were not mentioned.  The
    word long may be specified in conjunction with float; the meaning is
    the same as double.  The word unsigned may be specified alone, or in
    conjunction with int or any of its short or long varieties, or with
    char. 

I have no idea what the Berkeley compilers allow.
-- 
					Morris M. Keesan
					{decvax,linus,wjh12,ima}!bbncca!keesan
					keesan @ BBN-UNIX.ARPA



More information about the Comp.unix.wizards mailing list