From owner-freebsd-hackers Tue Jun 3 00:24:10 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id AAA12698 for hackers-outgoing; Tue, 3 Jun 1997 00:24:10 -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 AAA12691 for ; Tue, 3 Jun 1997 00:24:06 -0700 (PDT) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) id QAA02504; Tue, 3 Jun 1997 16:53:33 +0930 (CST) From: Michael Smith Message-Id: <199706030723.QAA02504@genesis.atrad.adelaide.edu.au> Subject: Re: signed/unsigned cpp In-Reply-To: from Steve Howe at "Jun 2, 97 10:21:16 pm" To: un_x@anchorage.net (Steve Howe) Date: Tue, 3 Jun 1997 16:53:33 +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: > On Tue, 3 Jun 1997, Michael Smith wrote: > > > 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". > > i'm in the middle of porting a bunch of code, and would like to do > it as "properly" as possible. can anyone tell me an instance > where declaring "char *" is of any benefit, as opposed to > explicitly defining "unsinged char *" or "signed char *" ? Use the explicit signed/unsigned types if you are performing arithmetic with your character variables and need a definite behaviour. Use the default type for other ("generic") operations. Avoid the use of "char" types unless specifically indicated, eg. don't use them for flag values, loop counters in small loops, etc. -- ]] 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 [[