delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/02/12/15:54:56

Message-Id: <199902122054.PAA16714@delorie.com>
From: Robert Hoehne <robert DOT hoehne AT gmx DOT net>
Organization: none provided
To: djgpp-workers AT delorie DOT com
Date: Fri, 12 Feb 1999 21:55:17 +0100
MIME-Version: 1.0
Subject: Re: ctype functions
In-reply-to: <199902112120.QAA20563@envy.delorie.com>
References: <199902112029 DOT PAA12141 AT delorie DOT com> (message from Robert Hoehne on Thu,
11 Feb 1999 21:29:47 +0100)
X-mailer: Pegasus Mail for Win32 (v3.01d)
Reply-To: djgpp-workers AT delorie DOT com

> Your calls to them.  The ANSI spec very clearly states that the
> programmer must pass integer (not char!)  values in the range 0..255
> or the constant EOF to these functions.  Passing other values is
> illegal and the results are undefined.

In that case, the source files in src/libc/compat/string/ (and maybe
also others) have to be fixed, since for instance in
src/libc/compat/string/stricmp.c is coded

int
stricmp(const char *s1, const char *s2)
{
  while (tolower(*s1) == tolower(*s2))
....

where a char is passed to tolower and not an int.

OK, and a last note: Since I don't have any ANSI spec
I want to know, if ANSI forbits the ctype functions to check
their arguments or not. If it is allowed then I would vote for
my patch sent already.

Robert

******************************************************
* email:   Robert Hoehne <robert DOT hoehne AT gmx DOT net>     *
* Post:    Am Berg 3, D-09573 Dittmannsdorf, Germany *
* WWW:     http://www.tu-chemnitz.de/~sho/rho        *
******************************************************

- Raw text -


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