what about to have at least “official” wrapper around printf?
Im using tinyprintf already with riot and to have PRINTF macro defined would make things much easier.
There are DEBUGs and LOGs together with printf-s sprinkled in the code. While DEBUG and LOG can be defined to custom functions, printf no. Thinking at printf.h with PRINTF macro + formatter macros defined - bad idea?
that would be even better indeed.
something like #define LOG_PRINTF(...) LOG(LOG_PRINTF, __VA_ARGS__) and to
forbid to use printf?
Hm, after thinking about this again, it's a bit more difficult, I guess. There
are three types of actions where I see a need for printing strings:
1.) logging (something similar to syslog or journal on Linux)
2.) debugging
3.) some kind of CLI (e.g. our shell)
1.) should be covered by LOG_* from log.h.
2.) is covered by DEBUG()
3.) still needs a concept
But in general, I agree that getting rid of printf() all over the code is
desirable.
I know a lot of us have been unhappy with (some aspects of) Newlib for a long
time, including the somewhat bloated implementation of printf(). However,
just curious what the concerns about bloat are. Is it related to not-optimized implementation, or providing options that aren't needed?
PRIu16 was not good example, PRIi8 is better, since it translates for example to “hhi” in my case, which is not so widely supported by minimal printf implementations.
if you want to use formatting macros I would go with one additional layer of macros like by default #define _PRIi8 PRIi8, that can be easily changed at one place.
as for the most un needed option of the year 2016:) - my target is riot running 6lowpan host with 6lowpan ndp support plus coap server on 8kB of ram. so do not have that much memory to waste for printf. Am I the only one?