forked from mpaland/printf
-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Labels
bugSomething isn't workingSomething isn't workingresolved-on-developA changeset fixing this issue has been commiutted to the development branchA changeset fixing this issue has been commiutted to the development branch
Description
Hi:
my test code is :
dbg("%#10b\n", 0xf);
dbg("%#10b\n", 0xff);
dbg("%#10b\n", 0x00);
dbg("%#010b\n", 0xff);
dbg("%#010b\n", 0x00);
output ('_' means space):
_____0b1111
0b11111111
____________0
0b011111111
0000000000
It seems:
- if val is 0, then no "0b" prefix
- "%#010b\n" have an extra 0, while width should be 10 ('0b' + 8bit) if I'm right
Is these a bug or I'm using it wrong?
My env:
keil mdk 5.36.0,with segger rtt output
#define dbg_log(...) fctprintf(putchar_custom_, (void *)0, __VA_ARGS__)
#define dbg_ext(...) fctprintf(putchar_custom_, (void *)1, __VA_ARGS__)
#define dbg dbg_log
void putchar_(char ch) { SEGGER_RTT_PutChar(0, ch); }
void putchar_custom_(char ch, void *arg) { SEGGER_RTT_PutChar((int)arg, ch); }
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingresolved-on-developA changeset fixing this issue has been commiutted to the development branchA changeset fixing this issue has been commiutted to the development branch