Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 May 2002 16:26:03 -0400 (EDT)
From:      Thomas David Rivers <rivers@dignus.com>
To:        fenner@research.att.com, tlambert2@mindspring.com
Cc:        audit@FreeBSD.ORG, current@FreeBSD.ORG, knu@iDaemons.org
Subject:   Re: moused(8): char signed-ness problem with gcc 3.1
Message-ID:  <200205152026.g4FKQ3746098@lakes.dignus.com>
In-Reply-To: <3CE2BBA2.9416C455@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Terry Lambert <tlambert2@mindspring.com> 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-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205152026.g4FKQ3746098>