From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GdtTf-0005bw-RX for qemu-devel@nongnu.org; Sat, 28 Oct 2006 15:04:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GdtTe-0005bM-ID for qemu-devel@nongnu.org; Sat, 28 Oct 2006 15:04:19 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GdtTe-0005bJ-El for qemu-devel@nongnu.org; Sat, 28 Oct 2006 15:04:18 -0400 Received: from [71.162.243.5] (helo=grelber.thyrsus.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GdtTe-0005ik-1F for qemu-devel@nongnu.org; Sat, 28 Oct 2006 15:04:18 -0400 From: Rob Landley Subject: Re: [Qemu-devel] [PATCH] Fix char signedness Date: Sat, 28 Oct 2006 15:04:08 -0400 References: <20061027.122311.-365734984.imp@bsdimp.com> <56d259a00610280346j5b88de07p203dd6f82c3543c2@mail.gmail.com> In-Reply-To: <56d259a00610280346j5b88de07p203dd6f82c3543c2@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610281504.08692.rob@landley.net> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: schwab@suse.de On Saturday 28 October 2006 6:46 am, Martin Guy wrote: > > gcc on ARM systems default to unsigned. The C standard specifically > > states that char is either signed or unsigned at the whim of the > > implementor > > Or, more to the point, at the behest of the machine architecture. > Having to generate code to sign-extend the hard way every time you do > char-integer promotion if the hardware doesn't do it automatically > would be long and inefficient, specially since it happens all the > time. I'd rather have inefficient than broken. And in general, using "char" as a small "int" is going to _suck_ on arm. The extra code size more than makes up for the data size you save if you only have one or two instances of your data at a time. Rob -- "Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away." - Antoine de Saint-Exupery