Due to the excessive size of my platform's standard library printf implementation, and being increasingly short on space, I'm writing my own very basic one.
I'm unsure about what exactly to do with the 'h' length modifier for integer format specifiers (e.g. %u, %d, %x, etc.) when the native word size for my 8-bit platform is 16-bits - that is,
int =
uint16_t, and
short ≡
int.
Now, according to the reference on
cppreference.com, the 'h' length modifier denotes a
short value, and indeed my platform's standard library implementation of printf ignores 'h' (because it would cause no difference in behaviour to
int). But I've also seen other printf implementations for 8-bit platforms that treat 'h' as
char. I suppose that would make sense if you interpret 'h' as meaning 'half', and
char is indeed 'half' of
int.
What to do?
