[libc-commits] [libc] [libc] Add baremetal printf (PR #94078)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Thu Jun 6 14:01:42 PDT 2024


================
@@ -0,0 +1,51 @@
+//===-- Implementation of printf for baremetal ------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/stdio/printf.h"
+#include "src/__support/arg_list.h"
+#include "src/stdio/printf_core/core_structs.h"
+#include "src/stdio/printf_core/printf_main.h"
+#include "src/stdio/printf_core/writer.h"
+
+#include <stdarg.h>
+
+// This is intended to be provided by the vendor. Name TBD
+extern "C" size_t __llvm_libc_raw_write(const char *s, size_t size);
----------------
michaelrj-google wrote:

I messed around with the design a bit and realized it's out of scope for this patch. I've filed an issue to track this further (https://github.com/llvm/llvm-project/issues/94685), but for now I'm going to land this patch as-is.

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


More information about the libc-commits mailing list