Subject: Re: Type coersion long->int ?
To: None <current-users@netbsd.org>
From: Peter Seebach <seebs@plethora.net>
List: current-users
Date: 02/02/2000 13:03:55
In message <20000202124838.A2607@realms.nimenees.com>, erh@nimenees.com writes:
>So wouldn't it make sense for it to interpret its argument as a character
>since it claims to take a character and not an int?
No.
>Or perhaps put the check
>for
>c<0 || c>128 in the isalpha function so you could correctly pass a char withou
>t
>checking it first? It seems kinda stupid that a function which is supposed to
>work on characters can't be passed everything that would fit in a char.
It is officially able to take anything that can fit in a char, and indeed, our
implementation can.
It doesn't have these checks because it's supposed to be fast; that's why all
the <ctype.h> functions have undefined behavior for things outside the
"standard" range.
-s