From e2b04b68473d020b392d268df42e75cbbfafc4da Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 19 Feb 2026 14:55:25 +0100 Subject: [PATCH] Don't use printf("%llu") We can't easily printf a `long long` on MingW yet, pending the work on https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/675 for which this is an early stage. A `long` is enough here anyway. Signed-off-by: Gilles Peskine --- programs/x509/load_roots.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/programs/x509/load_roots.c b/programs/x509/load_roots.c index 8fdccdd6ab..215d9453e2 100644 --- a/programs/x509/load_roots.c +++ b/programs/x509/load_roots.c @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) int exit_code = MBEDTLS_EXIT_FAILURE; unsigned i, j; struct mbedtls_timing_hr_time timer; - unsigned long long ms; + unsigned long ms; psa_status_t status = psa_crypto_init(); if (status != PSA_SUCCESS) { @@ -150,8 +150,10 @@ int main(int argc, char *argv[]) } mbedtls_printf("."); } - ms = mbedtls_timing_get_timer(&timer, 0); - mbedtls_printf("\n%u iterations -> %llu ms\n", opt.iterations, ms); + /* On 64-bit Windows and 32-bit platforms, this wraps after about + * 49.7 days. This shouldn't be a problem in practice. */ + ms = (unsigned long) mbedtls_timing_get_timer(&timer, 0); + mbedtls_printf("\n%u iterations -> %lu ms\n", opt.iterations, ms); exit_code = MBEDTLS_EXIT_SUCCESS; exit: