| Message ID | CAAHpriOJtTzYvQfE1Y1PSwi8PddS05M+pq-PxebdAndATr0PTg@mail.gmail.com |
|---|---|
| State | New |
| Headers |
Return-Path: <newlib-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 208654B9DB4A for <patchwork@sourceware.org>; Fri, 7 Aug 2026 22:01:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 208654B9DB4A Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=jhpnb+YZ X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id C4C294BA9028 for <newlib@sourceware.org>; Fri, 7 Aug 2026 22:00:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C4C294BA9028 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C4C294BA9028 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a00:1450:4864:20::431 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1786140060; cv=pass; b=G6Ebr5yyqzEZBrzB19y1EVS+G4TLZra8NVGIiCPbx2G7kfOixEXPdCRs8GYwZ8fzVGblq4P4XkLM5W3OX8ea6UHcPQsSqb0kguiQM3H18ZFE6eb26sCYL+SIczV8i7JEfZCaxBe/VR8AHD1sySpv+CvOtr6c5nk+w6eBAfIDot0= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1786140060; c=relaxed/simple; bh=gN59yxiTIeMGZA6TTPpmqH/e+FveiIp5Pr6l47TaLik=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=lnxbuDKSoRi9fDNaMKCI1cmZHGOFn7H9pb5zWVSlkhOPcmTWfzvMgQF3DoiGK6tNjmMm/HCk4+7NnnCWreZ5Ot3Y/nUJ3jTOtOmD+VYxkdT9OuPGn61XfTh1eVI9cTtXq5GawDJ2FL2PDjrLzBXJtChCXW6BH/H7nQsyRHDA0zU= ARC-Authentication-Results: i=2; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=jhpnb+YZ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4C294BA9028 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-47fde295992so22002f8f.0 for <newlib@sourceware.org>; Fri, 07 Aug 2026 15:00:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1786140058; cv=none; d=google.com; s=arc-20260327; b=SZX8QocuFG11v73PGRocJIxUhRwFX3tk/4NvMDUSBGJpRRYWFXmCPK4lCVA1k3F/fK 5CEIZE00medxSsfoFgbakIpRxva05SfL9ln2f2SgmrI0PvrL2JSDjrvr7aNoXMCSDJcD R5u3rdHV7bsiQPwH9hr8vDAy7nEqqmX9kQv2wU6Aj+J94rOMmZWWYx7Yeg8TLAAUWXCd MV0TAwhFDHUkmALtYYFQozxN2fiKU6W2jLrqV5rAG+dF/S69VaRojosNnlkqE15YnDr0 280+/pjXanShDGTatEoOo6C2Pefj6SyIt6AGP5VXyKMqAgs9RswYEtvDnezBdILeY7+y N56w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:mime-version:dkim-signature; bh=CRM/tonP5VWVxDkMmZm+WT4RAjXBEwnUy8Etlo9t6LU=; fh=vXXuC/85JTvlYw0SBaMOs+mKxufV04ctmssbrEMFycA=; b=I0DC2r7qnLLYVf4swj5JhFrYnqi0uJX5/bIjJQv474JdM31AIi3G1sX0GWR5tPxB1A 2vSlM3slmWRLRE3uvXKWRU0a6snFmA4MdbHRMU3bD2ZkrbBk7Ei5uhFafjRybJk3cz2f 5mwWftAMu95MbQ7gPwPWDsxWzg3H0y3jrRu+uEB6TMfZ5BQACfVkKPmCcJ2S7VRl4dnI bkmZIpEZvD3mjnHNtvYqFHpEvv1xhy72O663D1vfXOJRi2KcnSqpy7Ed7yyX5MhQbGlO K95+IxHmMklScBmw0/HQETLGmrVttN/Eu+ecgJcy7Iyp7pvjoudbMmywZerQkVRTYiEU egeg==; darn=sourceware.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786140058; x=1786744858; darn=sourceware.org; h=content-type:cc:to:subject:message-id:date:from:mime-version:from :to:cc:subject:date:message-id:reply-to:content-type; bh=CRM/tonP5VWVxDkMmZm+WT4RAjXBEwnUy8Etlo9t6LU=; b=jhpnb+YZgq2q7M7ct1/i1uDEzm12tlSVy+PRsPBNgYX/p2/ioevZRkfBLClv/s1MT3 4JCulTfohft141Gs2/i3oi5ECvgd4B34FL6Gjb+HhQFzm+kbfIBlN+R1PvX3bYjg142S 034dhOV5MtaPy9ndQa/jD6kDtfb0SbaSXANHoKcKD29AkFYCEb1V39iUoAFB4S/F8Yv9 fq+9EEi2Xox5/ub/tZye6duQWL6DhxV3L2Q6MzU4+pM8SnGGRF2SShSs7Kw9NONg4ysS xoHC5LiDRCqsRgkbo1aZxUOKtZuIwbYxbSaBLNHufnVSMmEucjh87sk01+tEPRODoO8Z eezg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786140058; x=1786744858; h=content-type:cc:to:subject:message-id:date:from:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=CRM/tonP5VWVxDkMmZm+WT4RAjXBEwnUy8Etlo9t6LU=; b=j0epNmcxD3P6YW39OfU4Ew34HexaLvdTKL4T+FNSHftFJcPB5EKwDBmd6IF5gHvWUB bolimoAk5MGR/Pueo/GA4hrpgyrvzrkCaZNrFfExJ9IuCmUUmCm7RZSTNM9BCoxUPYad owyMVo/gl0on+y/uvhkgHb5XRTWvz9OfEz7qv9p5ty+fnbFMp1AxULqHsY6f3PtOW3YN rmpavEltw5fhU4cDxzHisbQmlQ579cURm/RoRbo6lhrFInhIez+pzFeiBdTa4yt8Sya3 bieLSnElo1epAPMYRf2qWDe7+yZ+Y6XQHBgqMQQkhMayXsIe2pFjriu/FMQmhpQ9odv8 opnQ== X-Gm-Message-State: AOJu0Yy0FVy+sDNpI2AA3xAmD17oQnd7KhMr3kZffPvvSdzaqWUJfp+A CY+Jo99MpzIGdJH01E40DrdwZ8+sypvrxMHh0M+mPaEWhyveQNl0yK6VvQwOV1+G8RQ64JefPh6 +Ip0C++/r6FFCdbmQRelSbZS1LFeFAm2MeGz8BrQ= X-Gm-Gg: AR+sD1106fHzmsINpLPcG1a7gvVtnlTv3NgH6LQOFiTsj/bldNx+Kk9NE1pNjw0dXIz YqvhkPjjjhHaJj+PnCGw1/JKQno8m3702HdKRivnCPxevVTJvnb5xXqfqLq7sb+mhSd+kpWEcz7 eFLod1V7+GEiQSM4vWJsaloF7CW3U2hWs8+DgTN3tP4mSWCmCTE+JyO0/yCfVDhggYgYOK8arda QzwT5NjlfqMQHuG+/YPsCzHR9vZy8/N06ijRO8IXt8SFiW8lb17paEaZL5vzed7HfZ+hYpcbmNE VXGy09wSSC21P4O5KPP3UPIHxXZvfhZ773i1Z0R/irrtPXkt7GbVF4c= X-Received: by 2002:a05:6000:2913:b0:47f:7fe0:a287 with SMTP id ffacd0b85a97d-481319275b2mr1839383f8f.2.1786140058372; Fri, 07 Aug 2026 15:00:58 -0700 (PDT) MIME-Version: 1.0 From: Keith Thompson <Keith.S.Thompson@gmail.com> Date: Fri, 7 Aug 2026 15:00:46 -0700 X-Gm-Features: AUfX_mydU3B4wwPLR_SkzmYgwJ2_a9ukg2xWXQb8KClBx3IMjMqG1vLNnVTUlYo Message-ID: <CAAHpriOJtTzYvQfE1Y1PSwi8PddS05M+pq-PxebdAndATr0PTg@mail.gmail.com> Subject: The isspace(3) man page is out of date To: newlib@sourceware.org Cc: Keith Thompson <Keith.S.Thompson@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list <newlib.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/newlib>, <mailto:newlib-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/newlib/> List-Post: <mailto:newlib@sourceware.org> List-Help: <mailto:newlib-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/newlib>, <mailto:newlib-request@sourceware.org?subject=subscribe> Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
The isspace(3) man page is out of date
|
|
Commit Message
Keith Thompson
Aug. 7, 2026, 10 p.m. UTC
The isspace(3) man page incorrectly states that isspace(c) is defined
only when isascii(c) is true or c is EOF.
In fact, ISO C (going back to C89/C90) requires isspace(c) to work
correctly when c is either within the range of unsigned char or equal
to EOF (almost certainly 0..255 or -1 for systems supported by
newlib). The implementation of isspace() is correct; this is only a
documentation issue.
The other is*() functions work correctly and are documented correctly.
The following patch fixes this by copying the wording from isalpha().
I have *not* updated it to clarify just what "whitespace" means, but
it would probably be a good idea.
commit 932bca35395f3fc920b8d90b1f4bc07dc13efb93 (HEAD -> isspace-man-page)
Author: Keith Thompson <Keith.S.Thompson@gmail.com>
Date: 2026-08-07 14:50:36 -0700
Correct isspace(3) man page (copied wording from isalpha(3))
locale specified by the locale object locale. If <[locale]> is
Comments
On Fri, Aug 7, 2026 at 3:00 PM Keith Thompson <Keith.S.Thompson@gmail.com> wrote: > > The isspace(3) man page incorrectly states that isspace(c) is defined > only when isascii(c) is true or c is EOF. > > In fact, ISO C (going back to C89/C90) requires isspace(c) to work > correctly when c is either within the range of unsigned char or equal > to EOF (almost certainly 0..255 or -1 for systems supported by > newlib). The implementation of isspace() is correct; this is only a > documentation issue. > > The other is*() functions work correctly and are documented correctly. > > The following patch fixes this by copying the wording from isalpha(). > > I have *not* updated it to clarify just what "whitespace" means, but > it would probably be a good idea. > > commit 932bca35395f3fc920b8d90b1f4bc07dc13efb93 (HEAD -> isspace-man-page) > Author: Keith Thompson <Keith.S.Thompson@gmail.com> > Date: 2026-08-07 14:50:36 -0700 > > Correct isspace(3) man page (copied wording from isalpha(3)) > > diff --git newlib/libc/ctype/isspace.c newlib/libc/ctype/isspace.c > index 0def2c0ce..784f4d7ae 100644 > --- newlib/libc/ctype/isspace.c > +++ newlib/libc/ctype/isspace.c > @@ -18,7 +18,8 @@ SYNOPSIS > DESCRIPTION > <<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. > +characters, and 0 for other characters. It is defined only if > +<[c]> is representable as an unsigned char or if <[c]> is EOF. > > <<isspace_l>> is like <<isspace>> but performs the check based on the > locale specified by the locale object locale. If <[locale]> is Looking back at the history of <git://sourceware.org/git/newlib-cygwin.git>, it appears that this was corrected for several functions in 2013. isspace() was apparently overlooked. commit cc88e009edc0ac57241551c8bff2ee21269a2fb6 Author: Corinna Vinschen <corinna@vinschen.de> Date: 2013-05-23 14:46:51 +0000
Patch manually typed in (please attach patches in the future so e-mail tools don't mess with the patch). Thanks, -- Jeff J. On Fri, Aug 7, 2026 at 6:01 PM Keith Thompson <Keith.S.Thompson@gmail.com> wrote: > The isspace(3) man page incorrectly states that isspace(c) is defined > only when isascii(c) is true or c is EOF. > > In fact, ISO C (going back to C89/C90) requires isspace(c) to work > correctly when c is either within the range of unsigned char or equal > to EOF (almost certainly 0..255 or -1 for systems supported by > newlib). The implementation of isspace() is correct; this is only a > documentation issue. > > The other is*() functions work correctly and are documented correctly. > > The following patch fixes this by copying the wording from isalpha(). > > I have *not* updated it to clarify just what "whitespace" means, but > it would probably be a good idea. > > commit 932bca35395f3fc920b8d90b1f4bc07dc13efb93 (HEAD -> isspace-man-page) > Author: Keith Thompson <Keith.S.Thompson@gmail.com> > Date: 2026-08-07 14:50:36 -0700 > > Correct isspace(3) man page (copied wording from isalpha(3)) > > diff --git newlib/libc/ctype/isspace.c newlib/libc/ctype/isspace.c > index 0def2c0ce..784f4d7ae 100644 > --- newlib/libc/ctype/isspace.c > +++ newlib/libc/ctype/isspace.c > @@ -18,7 +18,8 @@ SYNOPSIS > DESCRIPTION > <<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. > +characters, and 0 for other characters. It is defined only if > +<[c]> is representable as an unsigned char or if <[c]> is EOF. > > <<isspace_l>> is like <<isspace>> but performs the check based on the > locale specified by the locale object locale. If <[locale]> is > >
diff --git newlib/libc/ctype/isspace.c newlib/libc/ctype/isspace.c index 0def2c0ce..784f4d7ae 100644 --- newlib/libc/ctype/isspace.c +++ newlib/libc/ctype/isspace.c @@ -18,7 +18,8 @@ SYNOPSIS DESCRIPTION <<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. +characters, and 0 for other characters. It is defined only if +<[c]> is representable as an unsigned char or if <[c]> is EOF. <<isspace_l>> is like <<isspace>> but performs the check based on the