[libc-commits] [libc] [libc] Support for scanf on baremetal (PR #131043)

Petr Hosek via libc-commits libc-commits at lists.llvm.org
Thu Mar 20 13:10:50 PDT 2025


================
@@ -0,0 +1,51 @@
+//===-- Implementation of vscanf --------------------------------*- 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/vscanf.h"
+
+#include "hdr/stdio_macros.h"
+#include "src/__support/OSUtil/io.h"
+#include "src/__support/arg_list.h"
+#include "src/__support/macros/config.h"
+#include "src/stdio/scanf_core/reader.h"
+#include "src/stdio/scanf_core/scanf_main.h"
+
+#include <stdarg.h>
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace {
+
+struct StreamReader : scanf_core::Reader<StreamReader> {
----------------
petrhosek wrote:

Done, I went with `StdinReader`.

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


More information about the libc-commits mailing list