Mail Archives: djgpp-workers/1999/02/12/07:38:21
DJ Delorie <dj AT delorie DOT com> 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
- Raw text -