[clang] [libc] [libc] Modular printf option (float only) (PR #147426)

Daniel Thornburgh via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 5 11:47:24 PST 2026


================
@@ -48,4 +48,24 @@
 
 // LIBC_COPT_PRINTF_NO_NULLPTR_CHECKS
 
+#ifdef LIBC_COPT_PRINTF_MODULAR
+#define LIBC_PRINTF_MODULE_DECL __attribute__((weak))
+#else
+#define LIBC_PRINTF_MODULE_DECL LIBC_INLINE
+#endif
+
+// LIBC_PRINTF_MODULE: Defines/declares a printf module.
+//
+// Usage: LIBC_PRINTF_MODULE((<signature>), { <body> })
+//
+// Note that the signature is parenthesized, but the body is not.
----------------
mysterymath wrote:

Fair point about the formatting; I tried to find a way to convince `clang-format` to do the right thing here, but to no avail. Done. Also, I think my approach may have broken str_from_util; if this only affects convert() proper, that should repair it.

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


More information about the cfe-commits mailing list