The isspace(3) man page is badly out of date (newlib)
Brian Inglis
Brian.Inglis@SystematicSW.ab.ca
Sat Aug 8 00:30:08 GMT 2026
On 2026-08-07 16:06, Keith Thompson via Cygwin wrote:
> On Fri, Aug 7, 2026 at 1:28 PM Keith Thompson
> <Keith.S.Thompson@gmail.com> wrote:
>>
>> The `isspace(3)` man page is badly out of date.
>>
>> "isspace is a macro which classifies singlebyte charset values by
>> table lookup. It is a predicate returning non-zero for whitespace
>> characters, and 0 for other characters. It is defined only when
>> isascii(c) is true or c is EOF."
>>
>> In fact, the ISO C standard, since C89/C90, requires that isspace(c)
>> is defined when c either representable as an unsigned char or equal to
>> EOF; the behavior is undefined for any other value.
>>
>> And the actual implementation of isspace() satisfies this requirement.
>> Only the man page is out of date.
>>
>> The man page is generated from newlib/libc/ctype/isspace.c in the
>> newlib git repo, <https://sourceware.org/git/newlib-cygwin.git>.
>>
>> This only affects the isspace(3) man page. The other is*(3) man pages
>> are correct.
>>
>> A couple of minor points affecting all the <ctype.h> functions/macros:
>>
>> There are two occurrences of "#include <ctype.h>" in the SYNOPSIS
>> section. The second occurrence is indented too far:
>>
>> SYNOPSIS
>> #include <ctype.h>
>>
>> int isspace(int c);
>>
>> #include <ctype.h>
>>
>> int isspace_l(int c, locale_t locale);
>>
>> A lot of library man pages refer to "ANSI C". "ISO C" would be
>> more accurate. The term "ANSI C" is ambiguous. Since 1990, the
>> C standard is controlled by ISO; ANSI adopts each ISO C standard
>> after it's published.
>
> I've reported this, with a proposed patch, to the
> newlib@sourceware.org mailing list.
>
> https://sourceware.org/pipermail/newlib/2026/022575.html
The correct wording appears in the isspace(3p) man page when Cygwin package
man-pages-posix is installed (this is the 2018 SUSv4 release, as POSIX has not
yet publicly released the SUSv5 2024 man pages, although isspace(3p) has not
changed since SUSv3 Issue 6 2001, but isspace_l(3p) was added in SUSv4 Issue 7
2018).
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher but when there is no more to cut
-- Antoine de Saint-Exupéry
More information about the Cygwin
mailing list