delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/02/12/07:11:34

Sender: vheyndri AT rug DOT ac DOT be
Message-Id: <34E2DDC9.4DCD@rug.ac.be>
Date: Thu, 12 Feb 1998 12:32:25 +0100
From: Vik Heyndrickx <Vik DOT Heyndrickx AT rug DOT ac DOT be>
Mime-Version: 1.0
To: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Cc: DJ Delorie <dj AT delorie DOT com>, djgpp-workers AT delorie DOT com
Subject: Re: char != unsigned char... sometimes, sigh (long)
References: <Pine DOT LNX DOT 3 DOT 93 DOT 980210162720 DOT 32596C-100000 AT acp3bf>

Hans-Bernhard Broeker wrote:
> 
> On Tue, 10 Feb 1998, Vik Heyndrickx wrote:
> 
> > - many users do not expect that '`' (the Greek letter alpha with EASCII
> > value 224 in DOS CP 437 or 850) is not equal to 224. IMHO, this is
> > strongly counterintuitive. This triggers unexpected (and never wanted)
> > outputs in printf("%d", ...) and printf ("%u", ...) statements.
> 
> I don't think we should pay that much attention to what users _expect_,
> even more so if they expect the wrong things... E.g., I can't see any good
> reason why anyone should 'printf("%d", '`'). If you want a char to
> represent a *number*, then why (other than for the IOCCC)  would you want
> to assign a value in '' notation to it? Users who mix up the use of 'char'
> for actual characters, and for 'small integers' might as well get what
> they asked for.

To support my idea of users expecting things:
--------------------------------------------
The following is a short quote from
http://i44www.info.uni-karlsruhe.de/~drepper/conf96/paper-5.html 
by Ulrich Drepper (a non-newbie!)
---------------------------------------------------------------------------------------
The existence of a character other than the default ASCII character set
is completely transparent to the program. Depending on the currently
selected locale for the category LC_CYTPE the function can returned
different values. Example: 
ASCII character set
      isalpha('|') == 0 && toupper('|') == '|'
ISO-8859-1 character set
      isalpha('|') != 0 && toupper('|') == '\'
---------------------------------------------------------------------------------------
Although this is only example code, even he takes it for granted that
'|' is a positive value.
To make my point: I think we SHOULD pay much attention to what users
expect and solve the problem at the origin.

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

- Raw text -


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