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

Michael Jones via libc-commits libc-commits at lists.llvm.org
Thu Dec 4 13:53:33 PST 2025


================
@@ -33,7 +37,27 @@ LIBC_INLINE int convert_char(Writer<write_mode> *writer,
     RET_IF_RESULT_NEGATIVE(writer->write(' ', padding_spaces));
   }
 
-  RET_IF_RESULT_NEGATIVE(writer->write(c));
+  if (to_conv.length_modifier == LengthModifier::l) {
----------------
michaelrj-google wrote:

this looks good overall, but we'll want to have a compile flag to disable wide characters to save code size. Could you add something similar to `LIBC_COPT_PRINTF_DISABLE_STRERROR` that just disables the wide character portion? You'll also need to guard the includes at the top of this file and the tests.

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


More information about the libc-commits mailing list