I've lived with the old definition so long that I didn't notice Plan 9's definition, which is not a problem on today's architectures because there are two equally efficient instructions to choose from.
Sent from my iPad > On Nov 23, 2015, at 7:05 AM, Charles Forsyth <charles.fors...@gmail.com> > wrote: > > >> On 23 November 2015 at 11:50, Brantley Coile <brantleyco...@me.com> wrote: >> It is undefined in C whether or not it sign extends or not. Some machines do >> it one way, some another. To force the language to one behavior requires >> more code on some architectures. > > Ironically for its use as an example, that's another case where Plan 9 C > defines the effect: char is always signed, unsigned char is the only unsigned > form, on all targets, just like int/unsigned int, short/unsigned short. The > abbreviation "uchar" makes it relatively painless. > It's just a pity that string literals must be char*, not uchar*, and all the > str* functions take char*.