This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]