[Bug libstdc++/115524] Cygwin: Space character categorized as non-printable by std::ctype<wchar_t>
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jan 9 11:31:02 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115524
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
>From 104587:
I believe I have analyzed a bug report from reddit (https://redd.it/sp52gq) to
be caused by the way libstdc++ builds on Cygwin.
The reported problem in a nutshell is that
regex_match(L"a", std::wregex(L"[[:xdigit:]]"))
erroneously evaluates to zero on current Cygwin, using GCC 11.2.0. AFAICS this
happens because the cygwin target uses the generic version of ctype_members.cc,
when it almost certainly should be picking up the newlib edition instead.
As-is, the generic version of _M_initialize_ctype tries to set up its 16-bit
character class masks, but the type of the array it stores those in,
std::ctype_base::mask, is just a plain 8-bit char in
config/os/newlib/ctype_base.h.
In terms of configuration options, Cygwin currently combines
os_include_dir=os/newlib
with
--enable-clocale-generic (by default)
and that fails to work.
More information about the Gcc-bugs
mailing list