Re: [RFC] Some sr.ht CI tweaking

Alejandro Colomar via Mutt-dev <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <aY32rj0mGcARMcEi@devuan>
Hi Daniel, Kevin,

On 2026-02-12T16:02:11+0100, Daniel Tameling wrote:
> On Thu, Feb 12, 2026 at 01:20:18PM +0800, Kevin J. McCarthy wrote:
> > 
> > The ones in wchar.h include wcrtomb(), mbrtowc(), and wcwidth().
> > 
> > So, in this case, why are we only getting in trouble with wcwidth(), but
> > not the first two?
> > 
> 
> FreeBSD defines wcwidth as __wcwidth [1] and has in a different header
> the complete implementation of __wcwidth so that it can always be
> inlined [2].  An undef wcwidth solves the problem.
> 
> Honestly, wchar.h and wctype.h are nowadays part of POSIX and the
> C standard,

To be precise, <wchar.h> and <wctype.h> were standardized in ISO C95
(ISO/IEC 9899:1990/Amd1:1995).  It is available as N412:
<https://www.open-std.org/jtc1/sc22/wg14/www/docs/n412.pdf>.

POSIX says that these two headers were added in Issue 4, which is XPG4
(the X/Open Portability Guide), released in 1992.  However, I don't know
any public copies of that.

Issue 5, which is SUSv2, aligned with C95.

I don't know if they were available as part of POSIX.1-1996, as SUS and
POSIX hadn't merged yet.  POSIX.1-1990 certainly didn't have them (but
it had wchar_t in <stdlib.h>):
<https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub151-2.pdf>
I don't know if there's any public copy of POSIX.1-1996.

Since mutt(1) requires C99, I think it would be reasonable to assume
that these headers exist, including iwblank().

> and have been for a long time. The workaround isn't really needed
> anymore.  If somebody disagrees, they should step up and maintain the
> code.  Your limited time is better spend elsewhere.
> 
> Maybe this excerpt from POSIX is the reason for the weirdness in the
> source code?
> 
>   "The iswblank() function was a late addition to the ISO C standard
>    and was introduced at the same time as the ISO C standard
>    introduced <wctype.h>, which contains all of the isw*() functions.

This claim from POSIX doesn't seem correct.  I can't find iswblank() in
ISO C95 (N412), while I can certainly find <wctype.h>.

Even in ISO C96 (ISO/IEC 9899:1990/Cor2:1996), iswblank() still doesn't
appear: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n457.pdf>.

The first appearance of iswblank() seems to be in ISO C99.
POSIX added it in Issue 6 (POSIX.1-2001).

>    The Open Group Base Specifications had previously aligned with the
>    MSE working draft and had introduced the rest of the isw*()
>    functions into <wchar.h>.  For backwards-compatibility, the
>    original set of isw*() functions, without iswblank(), are permitted
>    (as an XSI extension) in <wchar.h>.  For maximum portability,
>    applications should include <wctype.h> in order to obtain
>    declarations for the isw*() functions."[3]

Yeah, just include both.  I think it was a mistake to have a single huge
header file for all wchar_t APIs.


Have a lovely day!
Alex

> 
> Best regards,
> Daniel
> 
> [1]: https://cgit.freebsd.org/src/tree/include/wchar.h#n221
> [2]: https://cgit.freebsd.org/src/tree/include/_ctype.h#n157
> [3]: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/wchar.h.html

-- 
<https://www.alejandro-colomar.es>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmmN/R8ACgkQ64mZXMKQ
wqnwrRAAhoZsQcNfu673g7eIXCStn7eWLxRFDAnMHRpiUKWw95mNyduw47mvDWJ9
ctt8YA/2iRdqKiv+xnlPDe+TaZ6AfkqPCZjsbYSfFyJvGuJ6DHbIeFCzYWkyBTsf
jFn6IyxTR8PF8uM9GFzVBkFRtwJt9WkkSIbzPHvg5rHRsFPsXiWmv+WZiPNkF0P7
UY/u9Bs6D0r3x9rvNPx+JN76mpmXKyIek0yhYshqtNBzXJ4T6JoUqcp3bM18hI45
Z7hQIsMfpDsrTmd3Qra00Sl5ZTWZC8E69RE0J0LpvKC9TwxdvBeZAeRS06fTmKkd
6debiVqc42RyjaCbLfO151T7rxRpyDh18jJVcHCFIRzUkjDFSqhB/fH6lkdCOZ9U
bKrCvWKuXnUtoAoVxZkEmASwfXS6WLfy0DfyXFaQLLwRsFJ2Sm3NsdO0JWMwpa76
TkVzFa++52suc51Wpt8glTff6s2bziH6nkEXsoaPari7Bvu5WOMuhIVtgrAlQ1mU
MeG7l7o8qCoFRkVYkJehKnbtol7t4Z9XRl0NkOEpbHlkO9rkpI95dMM2nkWYkjEb
7V+I5ZMlApPZprVCl7nXq0y5l7dAJ5gYXdlAgz/Sp/RK81wMVdazLBveTHbBPTGo
qStWHwvOUItdTtLt9ibhJYfdUSeXZFvHDR084grRIMLom8QF3kk=
=BTOc
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.