Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!batcomputer!itsgw!steinmetz!uunet!vsi!friedl From: friedl@vsi.COM (Stephen J. Friedl) Newsgroups: comp.lang.c Subject: Re: Why unsigned chars not default? Summary: Good reason for this Message-ID: <892@vsi.COM> Date: 22 Oct 88 04:12:45 GMT References: <9563@pur-ee.UUCP> Distribution: na Organization: V-Systems, Inc. -- Santa Ana, CA Lines: 29 In article <9563@pur-ee.UUCP>, mendozag@pur-ee.UUCP (Grado) writes: > > He claims the compilers are at fault and that all the compilers > should have 'unsigned char' as default for characters so you > can do all sorts of arithmetic with them. > Any comments and/or suggestions I can pass along? There are very good reasons for this. The large (overwhelming?) use of char variables is for characters, where sign is not an issue. While most modern architectures can handle all data types in both signed and unsigned manners, older machines had a "natural" method for byte handling with a substantial penalty for doing it "the other way". Apparently it was felt that this penalty was too high for what was seen as limited utility. If a machine supports signed and unsigned byte operations, it is up to the compiler writer to select which ever one she likes the most. The dpANS will allow the /signed/ keyword to do the obvious thing to chars, but it is unwise to rely on anything other than unsigned. -- Steve Friedl V-Systems, Inc. +1 714 545 6442 3B2-kind-of-guy friedl@vsi.com {backbones}!vsi.com!friedl attmail!vsi!friedl ---------Nancy Reagan on the Three Stooges: "Just say Moe"---------