minimal-printf: Explicitly print %ll[diuxX] when 64b disabled

pull/12233/head
Bartek Szatkowski 2020-02-19 11:40:16 +00:00
parent 554a04ba5f
commit f9be9dc5be
1 changed files with 20 additions and 0 deletions

View File

@ -502,6 +502,16 @@ int mbed_minimal_formatted_string(char *buffer, size_t length, const char *forma
/* use 64 bit storage type for readout */
value = va_arg(arguments, MBED_SIGNED_STORAGE);
} else
#else
/* If 64 bit is not enabled, print %ll[di] rather than truncated value */
if (length_modifier == LENGTH_LL) {
mbed_minimal_formatted_string_character(buffer, length, &result, '%', stream);
if (next == '%') {
// Continue printing loop after `%`
index = next_index;
}
continue;
}
#endif
{
/* use native storage type (which can be 32 or 64 bit) */
@ -551,6 +561,16 @@ int mbed_minimal_formatted_string(char *buffer, size_t length, const char *forma
/* use 64 bit storage type for readout */
value = va_arg(arguments, MBED_UNSIGNED_STORAGE);
} else
#else
/* If 64 bit is not enabled, print %ll[uxX] rather than truncated value */
if (length_modifier == LENGTH_LL) {
mbed_minimal_formatted_string_character(buffer, length, &result, '%', stream);
if (next == '%') {
// Continue printing loop after `%`
index = next_index;
}
continue;
}
#endif
{
/* use native storage type (which can be 32 or 64 bit) */