From owner-freebsd-audit Wed May 15 13:29:58 2002 Delivered-To: freebsd-audit@freebsd.org Received: from dignus.com (sdsl-64-32-254-102.dsl.iad.megapath.net [64.32.254.102]) by hub.freebsd.org (Postfix) with ESMTP id C013537B404; Wed, 15 May 2002 13:29:49 -0700 (PDT) Received: from lakes.dignus.com (lakes.dignus.com [10.0.0.3]) by dignus.com (8.11.6/8.11.3) with ESMTP id g4FKOua16003; Wed, 15 May 2002 16:24:56 -0400 (EDT) (envelope-from rivers@dignus.com) Received: (from rivers@localhost) by lakes.dignus.com (8.11.6/8.11.3) id g4FKQ3746098; Wed, 15 May 2002 16:26:03 -0400 (EDT) (envelope-from rivers) Date: Wed, 15 May 2002 16:26:03 -0400 (EDT) From: Thomas David Rivers Message-Id: <200205152026.g4FKQ3746098@lakes.dignus.com> To: fenner@research.att.com, tlambert2@mindspring.com Subject: Re: moused(8): char signed-ness problem with gcc 3.1 Cc: audit@FreeBSD.ORG, current@FreeBSD.ORG, knu@iDaemons.org In-Reply-To: <3CE2BBA2.9416C455@mindspring.com> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Terry Lambert wrote: > > Bill Fenner wrote: > > gcc 3.1 simply defaults to unsigned chars. 127 << 1 = 254; 254 / 2 = 127. > > > > My machine is too slow to test this expeditiously, but I'm trying > > adding "#define DEFAULT_SIGNED_CHAR 1" into freebsd-native.h . > > I will bet today's lunch money that you have found it for sure. > > I guess we will have to go around adding "signed" everywhere, if > it's no longer the default. > > Unsigned is a stupid, counter-intuitive default, and has been, > ever since I first used AIX. > > My bet is a conspiracy by AIX folks so that Open Source software > will work on AIX without them having to fix their stupid defaults. > > 8-) 8-). Well - it's not counter-intuitive on many machines... For example, on the IBM mainframe - there is an instruction to load a character into a register - but not one that loads *and* sign-extends. So, you can get much better code if characters are unsigned by default. So in our C/C++ compilers for the mainframe, the default is unsigned as well. I wonder if the AIX people were looking for mainframe compatibility in this decision, or was it motivated by the PowerPC instruction set? Does anyone know what the Mac default is (since they are PowerPC based as well?) - Dave Rivers - -- rivers@dignus.com Work: (919) 676-0847 Get your mainframe programming tools at http://www.dignus.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message