Terry Lambert <[EMAIL PROTECTED]> 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 -

[EMAIL PROTECTED]                        Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to