nanoprintf: a tiny embeddable printf replacement written in C89/C99

nanoprintf is an implementation of snprintf and vsnprintf for embedded systems that aims for C11 standard compliance. nanoprintf makes no memory allocations, uses less than 100 bytes of stack, and is smaller than 5KB of ARM Cortex-M object code when optimized with all the bells and whistles turned on (slightly larger on x64, where you don’t want to use it anyway). nanoprintf is a single header file in the style of the stb libraries. The rest of the repository is tests and scaffolding and not required for use. nanoprintf is written in C89 for maximal compiler compatibility. C99 or C++11 compilers are required (for uint64_t and other types) if floating point conversion or large modifiers are enabled. nanoprintf does include standard headers but only uses them for types and argument lists; no calls are made into stdlib / libc, with the exception of any internal double-to-float conversion ABI calls your compiler might emit. nanoprintf is statically configurable so users can find a balance between size, compiler requirements, and feature set. […]

https://github.com/charlesnicholson/nanoprintf

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s