The custom core::vsnprint parser does not handle leading zero flags or width limits (e.g. %02X prints as ?2X on target boot logs for the Ethernet MAC address). Additionally, %X is not supported (only lowercase %x is supported which prepends 0x to all hex outputs).
This task will:
- Enhance
print_number and print_signed_number to support width, padding, uppercase hex, and signs.
- Update
core::vsnprint formatting parser to parse leading zero flags and widths prior to length modifiers.
- Implement
%X specifier (uppercase hex without prepending 0x).
- Adjust width calculations for
%x and %b to account for prepended prefixes.
- Create unit tests under
catch2-vsnprint.cpp to verify all formatting.
The custom
core::vsnprintparser does not handle leading zero flags or width limits (e.g.%02Xprints as?2Xon target boot logs for the Ethernet MAC address). Additionally,%Xis not supported (only lowercase%xis supported which prepends0xto all hex outputs).This task will:
print_numberandprint_signed_numberto support width, padding, uppercase hex, and signs.core::vsnprintformatting parser to parse leading zero flags and widths prior to length modifiers.%Xspecifier (uppercase hex without prepending0x).%xand%bto account for prepended prefixes.catch2-vsnprint.cppto verify all formatting.