[libc-commits] [libc] [libc] Add iswctype and wctype (PR #191178)
Zile Xiong via libc-commits
libc-commits at lists.llvm.org
Thu Apr 9 08:05:06 PDT 2026
xiongzile wrote:
This change is relatively large; a few points may be worth focusing on during review:
1. `wctype_t` is currently defined as `unsigned int`. This is mainly to keep the implementation simple for now. I’m open to adjusting the representation if there are stricter expectations in LLVM libc.
2. `wctype_overlay.h` is largely copied from `wint_overlay.h`, with the main difference being that it includes `<wctype.h>` instead of `<wchar.h>`. No additional behavior changes were introduced here beyond adapting the existing overlay pattern.
3. To minimize dependencies in `wctype_utils.h`, I reimplemented a minimal `strcmp` (`simple_strcmp`) locally, and did not introduce an explicit `enum` for the ctype descriptors. The current approach favors being self-contained; I can refactor this if a more structured representation is preferred.
4. The current implementation only handles ASCII and does not support UTF-8 / locale-aware behavior. This is a limitation of the current patch and would need to be addressed separately if broader character set support is required.
These are the main areas where design trade-offs were made, so feedback on them would be particularly helpful.
https://github.com/llvm/llvm-project/pull/191178
More information about the libc-commits
mailing list