[libc-commits] [libc] [libc] Support %lc in printf (PR #169983)

Alexey Samsonov via libc-commits libc-commits at lists.llvm.org
Sun Dec 21 11:00:47 PST 2025


================
@@ -173,7 +177,12 @@ template <typename ArgProvider> class Parser {
         section.has_conv = true;
         break;
       case ('c'):
-        WRITE_ARG_VAL_SIMPLEST(section.conv_val_raw, int, conv_index);
+#ifndef LIBC_COPT_PRINTF_DISABLE_WIDE
+        if (section.length_modifier == LengthModifier::l) {
+          WRITE_ARG_VAL_SIMPLEST(section.conv_val_raw, wint_t, conv_index);
+        } else
+#endif // LIBC_COPT_PRINTF_DISABLE_WIDE
+          WRITE_ARG_VAL_SIMPLEST(section.conv_val_raw, int, conv_index);
----------------
vonosmas wrote:

See my note in a separate place - I may defer to @michaelrj-google but would prefer to not change the control flow based on #ifdefs (same below)

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


More information about the libc-commits mailing list