[libc-commits] [clang] [libc] [libc] Modular printf option (float only) (PR #147426)
Simon Tatham via libc-commits
libc-commits at lists.llvm.org
Wed Jan 7 06:11:00 PST 2026
================
@@ -51,7 +52,9 @@ LIBC_INLINE ErrorOr<size_t> vasprintf_internal(char **ret,
init_buff_on_stack, DEFAULT_BUFFER_SIZE, resize_overflow_hook);
printf_core::Writer writer(wb);
- auto ret_val = printf_core::printf_main(&writer, format, args);
+ auto ret_val = use_modular
+ ? printf_core::printf_main_modular(&writer, format, args)
+ : printf_core::printf_main(&writer, format, args);
----------------
statham-arm wrote:
Does this _guarantee_ that the other function won't be included in the link anyway? E.g. if building at `-O0` for debugging, might this test of a compile-time constant expression be evaluated at run time anyway? Would it be a better idea to make this an `if constexpr`?
https://github.com/llvm/llvm-project/pull/147426
More information about the libc-commits
mailing list