This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Signed arguments to isspace et al
- From: Florian Weimer <fweimer at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Thu, 13 Sep 2012 16:08:58 +0200
- Subject: Signed arguments to isspace et al
Suppose c is a char and has a negative value distinct from EOF.
According to the C standard, isspace(c) is undefined. However, a lot of
code doesn't perform the cast to unsigned char. I wonder if we support
this usage to some degree?
There's also the additional complicate that isalpha(EOF) and
isalpha(255) mean two different things in many locales. For instance,
isalpha('ÿ') would probably return false in a ISO-8859-1 locale if
running on an architecture with signed chars. I expect that returning
false for negative c would probably good enough.
--
Florian Weimer / Red Hat Product Security Team