AnsweredAssumed Answered

DbgConsole_PrintfFormattedData() does not implement width and precision as specified in Kinetis SDK v.2.0 API Reference Manual

Question asked by Dan Teodorescu on Sep 29, 2016
Latest reply on Oct 12, 2016 by Dan Teodorescu

Hello,

 

I am trying to print a string of a width specified as an argument using the following syntax, as described on cppreference.com (std::printf, std::fprintf, std::sprintf, std::snprintf - cppreference.com )

 

`

 const char* s = "Hello";
PRINTF("\t[%10s]\n\t[%-10s]\n\t[%*s]\n\t[%-10.*s]\n\t[%-*.*s]\n",
s, s, 10, s, 4, s, 10, 4, s);

`

 

According to the Kinetis SDK v.2.0 API Reference Manual, I expect to see the same result as the reference output on cppreference.com, which is the following

`

 [ Hello]
[Hello ]
[ Hello]
[Hell ]
[Hell ]
`

 

Instead I see the following output.
`
[ Hello]
[Hello ]
[*s]
[*s]
[*.*s]
`

I verified that PRINTF_ADVANCED_ENABLE is defined and that code is included in my executable, by stepping through DbgConsole_PrintfFormattedData(). Preliminary analysis seems to indicate that support for argument-based (`*`) width or precision is not implemented, contrary to the SDK API Reference Manual.

 

Please confirm if I am overlooking any compilation setting that corrects this issue, or if you plan on addressing this in an upcoming SDK release.

 

Thank you,

Dan

Outcomes