www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/02/03/09:18:24

Sender: vheyndri AT rug DOT ac DOT be
Message-Id: <34D72299.3037@rug.ac.be>
Date: Tue, 03 Feb 1998 14:58:49 +0100
From: Vik Heyndrickx <Vik DOT Heyndrickx AT rug DOT ac DOT be>
Mime-Version: 1.0
To: DJ Delorie <dj AT delorie DOT com>
Cc: eliz AT is DOT elta DOT co DOT il, djgpp-workers AT delorie DOT com
Subject: Re: char != unsigned char... sometimes, sigh
References: <199802031335 DOT IAA27878 AT delorie DOT com>

DJ Delorie wrote:
> Unsigned char cannot hold a negative value.  SGI uses unsigned char,
> and this hits me a *lot*.  Many programs test for this during
> configure and use different code (or at least "signed char") to work
> around it.

But that is it just it! Program's relying on the signedness of char are
non-portable. There is nothing inhibiting any program from using "signed
char" explicitely when negative characters are important. And IMHO, I
don't call that a work around, but a sensible choice.
I cannot imagine that most gnu utilities for example should have to cope
with this problem, because they have to run on both kind of
architectures.
I even cannot imagine why configure should test this since using
'unsigned char' and 'signed char' would take away this problem in the
first place.

Not accepted as a good example.

-- 
 \ Vik /-_-_-_-_-_-_/   
  \___/ Heyndrickx /          
   \ /-_-_-_-_-_-_/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019