From mboxrd@z Thu Jan 1 00:00:00 1970 Content-type: multipart/alternative; boundary=Apple-Mail-2E2B3B79-B623-47E0-87D2-EC4CF6C436C2 MIME-version: 1.0 (1.0) From: Brantley Coile In-reply-to: Date: Mon, 23 Nov 2015 07:17:13 -0500 Content-transfer-encoding: 7bit Message-id: References: <1448274004.1751482.447419065.2BE466C4@webmail.messagingengine.com> <6B7DA7E3-3917-4A67-9084-1B5DD90D97F9@me.com> To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] Undefined Behaviour in C Topicbox-Message-UUID: 76fc5fbe-ead9-11e9-9d60-3106f5b1d025 --Apple-Mail-2E2B3B79-B623-47E0-87D2-EC4CF6C436C2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable I've lived with the old definition so long that I didn't notice Plan 9's def= inition, which is not a problem on today's architectures because there are t= wo equally efficient instructions to choose from.=20 Sent from my iPad > On Nov 23, 2015, at 7:05 AM, Charles Forsyth w= rote: >=20 >=20 >> On 23 November 2015 at 11:50, Brantley Coile 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. >=20 > Ironically for its use as an example, that's another case where Plan 9 C d= efines 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 t= he str* functions take char*. --Apple-Mail-2E2B3B79-B623-47E0-87D2-EC4CF6C436C2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
I've lived with the old definition so l= ong that I didn't notice Plan 9's definition, which is not a problem on toda= y's architectures because there are two equally efficient instructions to ch= oose from. 

Sent from my iPad

On Nov 23, 2015, at 7= :05 AM, Charles Forsyth <cha= rles.forsyth@gmail.com> wrote:

= --Apple-Mail-2E2B3B79-B623-47E0-87D2-EC4CF6C436C2--