Skip to content

Commit b2832b3

Browse files
Fix wrong format string in alarm_pool_dump_key (#437)
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 ```
1 parent 060123d commit b2832b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/common/pico_time/time.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
#include <limits.h>
8+
#include <inttypes.h>
89
#include <stdio.h>
910
#include <stdlib.h>
1011
#include "pico.h"
@@ -278,7 +279,7 @@ static void alarm_pool_dump_key(pheap_node_id_t id, void *user_data) {
278279
#if PICO_ON_DEVICE
279280
printf("%lld (hi %02x)", to_us_since_boot(get_entry(pool, id)->target), *get_entry_id_high(pool, id));
280281
#else
281-
printf("%ld", to_us_since_boot(get_entry(pool, id)->target));
282+
printf(PRIu64, to_us_since_boot(get_entry(pool, id)->target));
282283
#endif
283284
}
284285

0 commit comments

Comments
 (0)