mirror of https://github.com/ARMmbed/mbed-os.git
Use PRIu32 to print uint32_t variable
As the variable underlying type size is different depending on the toolchain usedpull/11392/head
parent
e65a0c0a99
commit
8c22bbbbc8
|
|
@ -1365,7 +1365,7 @@ void ATHandler::write_int(int32_t param)
|
|||
// write the integer subparameter
|
||||
const int32_t str_len = 12;
|
||||
char number_string[str_len];
|
||||
int32_t result = sprintf(number_string, "%ld", param);
|
||||
int32_t result = sprintf(number_string, "%" PRIi32, param);
|
||||
if (result > 0 && result < str_len) {
|
||||
(void)write(number_string, strlen(number_string));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ val_status_t mbed_val_execute_non_secure_tests(uint32_t test_num, client_test_t
|
|||
while (tests_list[i] != NULL)
|
||||
{
|
||||
memset(testcase_name, 0, 100);
|
||||
sprintf(testcase_name, "Check%d", i);
|
||||
sprintf(testcase_name, "Check%" PRIu32, i);
|
||||
GREENTEA_TESTCASE_START(testcase_name);
|
||||
if (server_hs == TRUE)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ WEAK MBED_NORETURN mbed_error_status_t mbed_error(mbed_error_status_t error_stat
|
|||
mbed_error_printf("\n= System will be rebooted due to a fatal error =\n");
|
||||
if (report_error_ctx->error_reboot_count >= MBED_CONF_PLATFORM_ERROR_REBOOT_MAX) {
|
||||
//We have rebooted more than enough, hold the system here.
|
||||
mbed_error_printf("= Reboot count(=%ld) reached maximum, system will halt after rebooting =\n", report_error_ctx->error_reboot_count);
|
||||
mbed_error_printf("= Reboot count(=%" PRIi32") reached maximum, system will halt after rebooting =\n", report_error_ctx->error_reboot_count);
|
||||
}
|
||||
#endif
|
||||
system_reset();//do a system reset to get the system rebooted
|
||||
|
|
|
|||
Loading…
Reference in New Issue