AnsweredAssumed Answered

Printf length modifier problem

Question asked by Pielorz.Pawel on May 7, 2017
Latest reply on May 8, 2017 by Pielorz.Pawel

Hello,

I have encountered problem with printf function. I am using CycloneTCP stack, where %hhu identifiers were used and workeg good. I tried to port demo applications to CubeMX etc and I got eferything working well besides printf with %hhu identifiers.

I have created new project with only this function in it, here is the part of code:

size = sprintf(buffer, "%u, %hu, %hhu\n", 123, 123, 123);
HAL_UART_Transmit_IT(&huart3, buffer, size);

What I get is:

123, 123, hu

Doing the same in original demos of stack mentioned above give good results. What I tried is to change language standard to C11 but it didn't make any change.

 

 Have you met such a problem?

 

Regards,

Pawel

Outcomes