From owner-freebsd-hackers Mon Jun 2 08:29:49 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id IAA24131 for hackers-outgoing; Mon, 2 Jun 1997 08:29:49 -0700 (PDT) Received: from labs.usn.blaze.net.au (labs.usn.blaze.net.au [203.17.53.30]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id IAA24126 for ; Mon, 2 Jun 1997 08:29:45 -0700 (PDT) Received: from labs.usn.blaze.net.au (local [127.0.0.1]) by labs.usn.blaze.net.au (8.8.5/8.8.5) with ESMTP id BAA00871; Tue, 3 Jun 1997 01:29:26 +1000 (EST) Message-Id: <199706021529.BAA00871@labs.usn.blaze.net.au> X-Mailer: exmh version 2.0gamma 1/27/96 To: Michael Smith cc: un_x@anchorage.net (Steve Howe), hackers@FreeBSD.ORG Subject: Re: signed/unsigned cpp In-reply-to: Your message of "Mon, 02 Jun 1997 17:37:51 +0930." <199706020807.RAA20786@genesis.atrad.adelaide.edu.au> X-Face: (W@z~5kg?"+5?!2kHP)+l369.~a@oTl^8l87|/s8"EH?Uk~P#N+Ec~Z&@;'LL!;3?y Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 03 Jun 1997 01:29:25 +1000 From: David Nugent Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > > Because neither is equivalent to the "default" signedness. > > > > > > const char * is _not_ equivalent to const unsigned char *, or const > > > signed char *. > > > > i would appreciate it if you could explain further - why? > > any char * can _only_ be signed or unsigned, even if it's > > the default that makes it so. ? > > 'char' has three types of signedness; "signed", "unsigned" and "default". > > Signed and unsigned are obvious. Default means "use whatever is the default > on this platform". Thus, for portable code signed != unsigned != default. 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. :) Regards, David David Nugent - Unique Computing Pty Ltd - Melbourne, Australia Voice +61-3-9791-9547 Data/BBS +61-3-9792-3507 3:632/348@fidonet davidn@freebsd.org davidn@blaze.net.au http://www.blaze.net.au/~davidn/