I don't understand the why? on the why?
you all need to implement that printf things
can't you just implement dedicated functions,
one for each data_type? in ADA style?
out_uint32(string_t msg_head, uint32_t data, string_t msg_tail);
out_sint32(string_t msg_head, sint32_t data, string_t msg_tail);
out_fp32(string_t msg_head, fp32_t data, string_t msg_tail);
out_fx32(string_t msg_head, fx32_t data, string_t msg_tail);
msg_head can be empty "", or "\0", therefore skipped
msg_tail can contain the CR "\n"
from my point of view, it's
- simpler
- safer
- less error prone
- doesn't require any stack manipulation
- consumes less resources
fp32 is for floating point
fx32 is for fixedpoint
they both need some additional work