delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/02/08/06:50:58

Date: Sun, 8 Feb 1998 13:50:42 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Vik Heyndrickx <Vik DOT Heyndrickx AT rug DOT ac DOT be>
cc: DJ Delorie <dj AT delorie DOT com>, djgpp-workers AT delorie DOT com
Subject: Re: char != unsigned char... sometimes, sigh
In-Reply-To: <34DAC2A1.7E06@rug.ac.be>
Message-ID: <Pine.SUN.3.91.980208135023.6339N-100000@is>
MIME-Version: 1.0

On Fri, 6 Feb 1998, Vik Heyndrickx wrote:

> Yes, very wrong:
> The ANSI standard requires that the is* macros work for any int value in
> the range of "unsigned char" and for EOF. The anding was primarily used
> to turn the values in the signed char range into the unsigned char
> range.

Negative numbers from the signed char range do not belong to the
unsigned char range.  People who use signed char for characters with
ASCII code beyond 127 write buggy code; they should use unsigned char
instead.

I agree that it would be nice to have the ctype functions/macros
support the cases such as `(char)0x84', but if that support causes the
library to break ANSI compliance, and no viable solution could be
found, I have no problems with unsupporting it.

- Raw text -


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