That is normally enough to reduce the footprint of printf by more than an order of magnitude, making it compatible with small microcontrollers.
And it all falls apart as soon as a format string cannot be known at compile time.
Compilers do that, at least for the simple case of constant strings; gcc can compile a printf call as puts. See https://stackoverflow.com/questions/60080021/compiler-change...
What if it could convert:
printf("parsed: %s to %i\n", x, y);
To:
puts("parsed: "); puts(x); puts(" to "); _puti(y); putc('\n');
Well. Then we'd have a lot more function calls overhead. Maybe something like:
_printf_nofloat("parsed: %s to %i\n", x, y);
It also removes calls to printf("") and changes single character printf calls to putchar calls
See https://github.com/gcc-mirror/gcc/blob/ef32bd8c866a1b8a97f62...