isspace() & i18n

Earnie Boyd
Wed May 30 09:59:00 GMT 2001

Kazuhiro Fujieda wrote:
> >>> On Wed, 30 May 2001 18:11:56 +0400
> >>> egor duda <> said:
> > i think we should either conform to standard and explicitly convert
> > types or define appropriate strings as unsigned char*, (typedef PATH_STR,
> > perhaps), or define cygwin_is*() as macros that do the conversion, or,
> > as glibc does, expand _ctype to allow indices in range [-128,256].
> The last is preferable.
> The ISO C standard specifies is* facilities operate properly on
> all values representable as type `char' and type `unsigned char'.
> It depends on implementation whether char is signed or unsigned.
> The is* facilities should operate on range [-128,256] on the
> implementation where char is singied.



     #include <ctype.h>

     int isspace(int c);


     The isspace() function tests whether c is a character of class
space in the program's current locale, see the XBD specification, Locale

     In all cases c is an int, the value of which must be a character
representable as an unsigned char or must equal the value of the macro
EOF. If the argument has any other value, the behaviour is undefined. 


     The isspace() function returns non-zero if c is a white-space
character; otherwise it returns 0. 


     No errors are defined. 

So given the above definition then the value passed must represent an
unsigned char otherwise the behaviour is undefined.  I think it operates
as described.


Do You Yahoo!?
Get your free address at

More information about the Cygwin-developers mailing list