[libc-commits] [libc] [libc] Add printf error handling (with fixes) (PR #166382)
Marcell Leleszi via libc-commits
libc-commits at lists.llvm.org
Tue Nov 4 11:16:05 PST 2025
================
@@ -32,6 +32,17 @@ if(printf_config_copts)
list(PREPEND printf_config_copts "COMPILE_OPTIONS")
endif()
+if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS})
+ add_subdirectory(${LIBC_TARGET_OS})
+else()
+ add_subdirectory(generic)
+endif()
+
+set(target_error_mapper libc.src.stdio.printf_core.${LIBC_TARGET_OS}.error_mapper)
+if(NOT TARGET ${target_error_converter})
----------------
mleleszi wrote:
Good catch! Actually there was an issue with a test that didn't run, had to change %n in the nullptr check test case for fprintf, as I was trying to test [write_int_converter.h#L29](https://github.com/llvm/llvm-project/blob/main/libc/src/stdio/printf_core/write_int_converter.h#L29), not the string conversion. Added a guard for LIBC_COPT_PRINTF_DISABLE_WRITE_INT
https://github.com/llvm/llvm-project/pull/166382
More information about the libc-commits
mailing list