[libc-commits] [libc] [libc][wctype] Add cmake flag for configuring wctype implementation used (PR #170531)

via libc-commits libc-commits at lists.llvm.org
Wed Dec 3 10:43:16 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Marcell Leleszi (mleleszi)

<details>
<summary>Changes</summary>

#<!-- -->170525 

Based on our [RFC](https://discourse.llvm.org/t/rfc-libc-wctype-header-implementation/88941/10), we are starting the implementation of the wctype header with C.UTF8 support. This implementation will increase the binary size by approximately ~70KB, so this PR introduces a flag so that this is configurable, allowing the user to choose between a simple ASCII implementation or the full Unicode one.

---
Full diff: https://github.com/llvm/llvm-project/pull/170531.diff


1 Files Affected:

- (modified) libc/config/config.json (+6) 


``````````diff
diff --git a/libc/config/config.json b/libc/config/config.json
index cfbe9a43948ea..a7844e4fe2dd1 100644
--- a/libc/config/config.json
+++ b/libc/config/config.json
@@ -130,5 +130,11 @@
       "value": true,
       "doc": "Add nullptr checks in the library's implementations to some functions for which passing nullptr is undefined behavior."
     }
+  },
+  "wctype": {
+    "LIBC_CONF_WCTYPE_MODE": {
+      "value": "LIBC_WCTYPE_MODE_ASCII",
+      "doc": "The implementation used for wctype, acceptable values are LIBC_WCTYPE_MODE_ASCII and LIBC_WCTYPE_MODE_UTF8."
+    }
   }
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/170531


More information about the libc-commits mailing list