From 955600f1f3f26fb12cdb90db6306193effa1eb3a Mon Sep 17 00:00:00 2001 From: Jonathan Reichelt Gjertsen Date: Sun, 23 May 2021 15:28:20 +0200 Subject: [PATCH] Fix wrong format string in alarm_pool_dump_key Fixes the following warning when building for host ``` [...]/pico-sdk/src/common/pico_time/time.c: In function 'alarm_pool_dump_key': [...]/pico-sdk/src/common/pico_time/time.c:282:15: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=] printf("%ld", to_us_since_boot(get_entry(pool, id)->target)); ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %I64d ``` --- src/common/pico_time/time.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/pico_time/time.c b/src/common/pico_time/time.c index ec925fa99..7c06041cb 100644 --- a/src/common/pico_time/time.c +++ b/src/common/pico_time/time.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include "pico.h" @@ -278,7 +279,7 @@ static void alarm_pool_dump_key(pheap_node_id_t id, void *user_data) { #if PICO_ON_DEVICE printf("%lld (hi %02x)", to_us_since_boot(get_entry(pool, id)->target), *get_entry_id_high(pool, id)); #else - printf("%ld", to_us_since_boot(get_entry(pool, id)->target)); + printf(PRIu64, to_us_since_boot(get_entry(pool, id)->target)); #endif }