[libc-commits] [libc] [libc] Add putc, fputc, and fprintf to stdio/baremetal (PR #144567)

Petr Hosek via libc-commits libc-commits at lists.llvm.org
Tue Jun 17 12:31:17 PDT 2025


petrhosek wrote:

What's the motivation for this change? Do you have a concrete use cases or are you just filling in blanks? To give you some context, we omitted the `stdio.h` functions that take `FILE*` in the baremetal configuration deliberately because that brings additional complexity and our position is that baremetal code should ideally only use `printf` and `scanf` (and `putchar`) which easily map onto serial I/O but the `FILE*` does not is going to be platform dependent (I'm ignoring semihosting which is a separate configuration). That position won't be practical or sustainable in the long run since there are baremetal project that use existing libraries which weren't design for baremetal use and we will need a way to support `FILE*` in baremetal configurations. We already discussed different approaches in the past Embedded Toolchains, LLVM libc and libc++ meetings but we haven't yet written down the outcome of those discussions and the actual design. That's something we need to do before going too far with the implementation because it will also have implications on LLVM libc users and for other libraries that sit on top like libc++.

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


More information about the libc-commits mailing list