From owner-freebsd-hackers Mon Jun 2 23:19:30 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id XAA09335 for hackers-outgoing; Mon, 2 Jun 1997 23:19:30 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id XAA09329 for ; Mon, 2 Jun 1997 23:19:20 -0700 (PDT) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) id PAA01871; Tue, 3 Jun 1997 15:49:02 +0930 (CST) From: Michael Smith Message-Id: <199706030619.PAA01871@genesis.atrad.adelaide.edu.au> Subject: Re: signed/unsigned cpp In-Reply-To: from Steve Howe at "Jun 2, 97 09:40:41 pm" To: un_x@anchorage.net (Steve Howe) Date: Tue, 3 Jun 1997 15:49:02 +0930 (CST) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Steve Howe stands accused of saying: > > > > > It isn't only a portability issue, but also a c++ standards issue. > > c++ distinguishes between these three types. Ansi c only has two > > and there it *is* a portability issue as to whether char* is signed > > or unsigned. This is one of the many ambiguities that c++ has the > > luxury to resolve. :) > > i hate to carry on anything trivial ... but, > > having a "default signedness" seems like trouble to me. when you > are writing code, you should have some intentions for a signedness. > imho, c++ should've just kept 2 types of signedness and made sure > one or the other was always specified - then you wouldn't have > the kludge of "whatever some other compiler deems it to be". > i can't imagine a worthwhile use of that. Then I suggest that you hang around for a few more years, and get work on a few more platforms under your belt. In time, you will probably appreciate the distinction well enough. > if i am using an "unsigned char *", i expect my code to use an > "unsigned char *". it does not benefit any cross-compiler > or any other architecture to say "no - i will use it as > a signed char *". > > but i have been wrong before :) No, there you are quite right. But if I use a "char" type, I know not to explicitly expect it to be either "signed" or "unsigned". -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[