From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <239c41a785c8c5638338c2f007f50733@vitanuova.com> From: C H Forsyth Date: Fri, 23 Apr 2010 19:53:24 +0100 To: 9fans@9fans.net In-Reply-To: <20100422224911.F14615B73@mail.bitblocks.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] BUG!!! in Plan9 compiler! Topicbox-Message-UUID: 0cc53c86-ead6-11e9-9d60-3106f5b1d025 >As per C89 in this case the unsigned char value should be >promoted to a *signed* int value. The sum will be of type >signed int and so the division will do the right thing. In >kencc case it seems the sum has type unsigned int for some >reason and further, the signed divisor (2) is promoted to an >unsigned int. Seems like a bug. on 19 April, I wrote: >notably the compiler doesn't implement the value-preserving rules for comparisons. ... >instead the compiler implements the older unsigned-preserving rule