delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/02/12/06:33:26

Sender: vheyndri AT rug DOT ac DOT be
Message-Id: <34E2DA00.217C@rug.ac.be>
Date: Thu, 12 Feb 1998 12:16:16 +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>, djgpp-workers AT delorie DOT com
Subject: Re: char != unsigned char... sometimes, sigh (long)
References: <199802092259 DOT RAA14332 AT delorie DOT com> <34E00C53 DOT 175A AT rug DOT ac DOT be>

I wrote:
> Pro's:
> ------
> - EOF is an element of the 'signed char' range which means that no
> matter what trickery is applied, only 256 distinct values can be
> represented of which EOF is one. This has as a consequence that locales
> that have a real character defined for value (char)255 (i.e. EOF) cannot
> be supported by ANY is* macro's, no matter how smart implemented. Those
> locales are non-fictitious. The 'unsigned char' range is completely
> distinct from EOF, which makes it much easier to implement a optimal
> performing library.

The only reason AFAIK that the Standard Committee decided that real
characters should lay in the 'unsigned char' is just because of this EOF
that needs to be a different value. This makes 'unsigned char' a better
choice for 'char' by default, even when NOT considering the possible
consequences.

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


- Raw text -


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