Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: DJ Delorie , djgpp-workers AT delorie DOT com Date: Fri, 12 Feb 1999 09:40:53 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT 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 Windows (v2.54) Reply-To: djgpp-workers AT delorie DOT com DJ Delorie wrote: > > My question is now: Are the ctype functions buggy or > > my calls to them? > > 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. I agree with DJ, lamentably the standard was designed for things like tolower(getch()) where the parameters match 100%. But Robert pointed a problem in stricmp that I can't check right now, but I think is a real problem. So the bug is in libc functions that pass *(char *) to ctype functions and it should be fixed. BTW: Robert, use the ucNNNN functions I added to TVision. Also, if the stricmp problem affects some code perhaps we can add a fixed version in nonansi.cc or in the "extras". SET ------------------------------------ 0 -------------------------------- Visit my home page: http://welcome.to/SetSoft or http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013