Show HN: Uprintf a universal stb-style printf implementation for C (no OS)

5 Forgret 2 8/20/2025, 10:46:58 AM
I've been frustrated by the lack of a truly portable, no-dependency printf for embedded and kernel development. Most solutions are either too bloated or missing key features. So I built Uprintf. It's a single-header library that gives you full printf (flags, width, precision, floats, even custom specifiers) from bare metal to desktop, with zero dependencies or #ifdef hell. Key features: · One header file, no dependencies, no dynamic allocation · Full standard support: %d, %x, %f, %.*s, etc. · Extensible with custom format handlers (add %T for your project) · Configurable: disable floats, set locale, etc. · MIT Licensed. GitHub: https://github.com/Ferki-git-creator/Uprintf I'd love your feedback and contributions!

Comments (2)

fjfaase · 2h ago
Nice work. I always have understood that snprintf does not write a null character when the produced string is longer than the given size. The snprintf function also can be called with a null pointer to calculate the length of the produced string.

You could add a c file with some unittests.

Forgret · 1h ago
Thanks, I will make and add unit tests As you requested, I'm already starting to do it, but in the meantime, if you want, you can support the project with a star. :)