Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jun 1997 16:53:33 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        un_x@anchorage.net (Steve Howe)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: signed/unsigned cpp
Message-ID:  <199706030723.QAA02504@genesis.atrad.adelaide.edu.au>
In-Reply-To: <Pine.BSF.3.95q.970602221732.5317A-100000@aak.anchorage.net> from Steve Howe at "Jun 2, 97 10:21:16 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
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  [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706030723.QAA02504>