Cygwin:C 标准库不支持 <uchar.h>?

Cygwin: C standard library does not support <uchar.h>?

场景:

$ echo "#include <uchar.h>" | gcc -xc - -std=c11 -pedantic -Wall -Wextra
<stdin>:1:10: fatal error: uchar.h: No such file or directory
compilation terminated.

$ gcc --version
gcc (GCC) 11.2.0

$ uname -a
CYGWIN_NT-10.0 xxx 3.3.4(0.341/5/3) 2022-01-31 19:35 x86_64 Cygwin

是否意味着 C 标准库不支持 <uchar.h>


更新。来自布赖恩·英格利斯:

Nobody else has noticed or mentioned those in the last decade, so there may not be (any updates), as volunteers have limited time and their own interests and priorities.

Given that newlib is a freestanding implementation, and gcc does not provide that header, those definitions or declarations, these are considered platform implementation issues, which someone supporting that platform has to decide if they will provide and support.

ICU provides uchar.h which Cygwin libicu-devel maintainer installs under /usr/include/unicode/ with Unicode licence under /usr/share/icu//LICENSE. You could pull those two files from the ICU distro for use in your work.

It also is/will be available on glibc platforms which support it. Remember that GNU products are GPL licensed with possibly undesirable requirements for most commercial products.

Similarly, TIME_UTC may not be available on some newlib platforms/targets, so it will be up to platform and/or target maintainers to decide if they can support it, and provide implementations.

I don't know what your host platform is, your newlib target, or what POSIX time.h CLOCK_/clock_... support is available, but you may wish to use that instead, until someone can provide the ISO C equivalent in newlib under a BSD licence.

You may also wish to look at what is available in *BSD sources.

安装libicu-devel包 header 将位于:

/usr/include/unicode/uchar.h