Skip to content

[stdio][baremetal] Fix templating for print functions #131232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2025

Conversation

PiJoules
Copy link
Contributor

This addresses build errors from #111559.

@llvmbot
Copy link
Member

llvmbot commented Mar 13, 2025

@llvm/pr-subscribers-libc

Author: None (PiJoules)

Changes

This addresses build errors from #111559.


Full diff: https://github.com/llvm/llvm-project/pull/131232.diff

2 Files Affected:

  • (modified) libc/src/stdio/baremetal/printf.cpp (+2-2)
  • (modified) libc/src/stdio/baremetal/vprintf.cpp (+2-2)
diff --git a/libc/src/stdio/baremetal/printf.cpp b/libc/src/stdio/baremetal/printf.cpp
index ff03f1f2f408b..c94698ec02953 100644
--- a/libc/src/stdio/baremetal/printf.cpp
+++ b/libc/src/stdio/baremetal/printf.cpp
@@ -38,9 +38,9 @@ LLVM_LIBC_FUNCTION(int, printf, (const char *__restrict format, ...)) {
   constexpr size_t BUFF_SIZE = 1024;
   char buffer[BUFF_SIZE];
 
-  printf_core::WriteBuffer<Mode<WriteMode::FLUSH_TO_STREAM>::value> wb(
+  printf_core::WriteBuffer<printf_core::WriteMode::FLUSH_TO_STREAM> wb(
       buffer, BUFF_SIZE, &raw_write_hook, nullptr);
-  printf_core::Writer writer(&wb);
+  printf_core::Writer<printf_core::WriteMode::FLUSH_TO_STREAM> writer(wb);
 
   int retval = printf_core::printf_main(&writer, format, args);
 
diff --git a/libc/src/stdio/baremetal/vprintf.cpp b/libc/src/stdio/baremetal/vprintf.cpp
index 8e49ed633c4f9..3e8631abd90d9 100644
--- a/libc/src/stdio/baremetal/vprintf.cpp
+++ b/libc/src/stdio/baremetal/vprintf.cpp
@@ -36,9 +36,9 @@ LLVM_LIBC_FUNCTION(int, vprintf,
   constexpr size_t BUFF_SIZE = 1024;
   char buffer[BUFF_SIZE];
 
-  printf_core::WriteBuffer<Mode<WriteMode::FLUSH_TO_STREAM>::value> wb(
+  printf_core::WriteBuffer<printf_core::WriteMode::FLUSH_TO_STREAM> wb(
       buffer, BUFF_SIZE, &raw_write_hook, nullptr);
-  printf_core::Writer writer(&wb);
+  printf_core::Writer<printf_core::WriteMode::FLUSH_TO_STREAM> writer(wb);
 
   int retval = printf_core::printf_main(&writer, format, args);
 

@PiJoules PiJoules merged commit 662bd4c into llvm:main Mar 13, 2025
15 of 17 checks passed
@PiJoules PiJoules deleted the printf-fixes branch March 13, 2025 22:30
frederik-h pushed a commit to frederik-h/llvm-project that referenced this pull request Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants